diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-06-13 17:52:48 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-06-13 19:48:07 -0300 |
commit | 052de475b9c6fc0c4670fc202ed24f75d12b1148 (patch) | |
tree | d48e5aad8c1220bda99ddea0885cc102ded7bb46 | |
parent | main.c: remove redundant has_cntrl_chars check (diff) | |
download | firejail-052de475b9c6fc0c4670fc202ed24f75d12b1148.tar.gz firejail-052de475b9c6fc0c4670fc202ed24f75d12b1148.tar.zst firejail-052de475b9c6fc0c4670fc202ed24f75d12b1148.zip |
util.c: increase name max length from 64 to 253
To match the hostname check in src/firejail/main.c.
-rw-r--r-- | src/firejail/util.c | 9 |
1 files changed, 4 insertions, 5 deletions
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) { | |||
1479 | // allow strict ASCII letters and numbers; names with only numbers are rejected; spaces are rejected | 1479 | // allow strict ASCII letters and numbers; names with only numbers are rejected; spaces are rejected |
1480 | int invalid_name(const char *name) { | 1480 | int invalid_name(const char *name) { |
1481 | const char *c = name; | 1481 | const char *c = name; |
1482 | |||
1483 | int only_numbers = 1; | 1482 | int only_numbers = 1; |
1483 | |||
1484 | if (strlen(name) > 253) | ||
1485 | return 1; | ||
1486 | |||
1484 | while (*c) { | 1487 | while (*c) { |
1485 | if (!ascii_isalnum(*c)) | 1488 | if (!ascii_isalnum(*c)) |
1486 | return 1; | 1489 | return 1; |
@@ -1491,10 +1494,6 @@ int invalid_name(const char *name) { | |||
1491 | if (only_numbers) | 1494 | if (only_numbers) |
1492 | return 1; | 1495 | return 1; |
1493 | 1496 | ||
1494 | // restrict name to 64 chars max | ||
1495 | if (strlen(name) > 64) | ||
1496 | return 1; | ||
1497 | |||
1498 | return 0; | 1497 | return 0; |
1499 | } | 1498 | } |
1500 | 1499 | ||