From 052de475b9c6fc0c4670fc202ed24f75d12b1148 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Tue, 13 Jun 2023 17:52:48 -0300 Subject: util.c: increase name max length from 64 to 253 To match the hostname check in src/firejail/main.c. --- src/firejail/util.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/firejail/util.c b/src/firejail/util.c index a0af3d4bf..78704fa64 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c @@ -1479,8 +1479,11 @@ int ascii_isxdigit(unsigned char c) { // allow strict ASCII letters and numbers; names with only numbers are rejected; spaces are rejected int invalid_name(const char *name) { const char *c = name; - int only_numbers = 1; + + if (strlen(name) > 253) + return 1; + while (*c) { if (!ascii_isalnum(*c)) return 1; @@ -1491,10 +1494,6 @@ int invalid_name(const char *name) { if (only_numbers) return 1; - // restrict name to 64 chars max - if (strlen(name) > 64) - return 1; - return 0; } -- cgit v1.2.3-54-g00ecf