From 7f712264ecffd9bcb59322b66fd6e3fb3d4c9a3c Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Fri, 5 Sep 2025 21:22:12 +0000 Subject: [PATCH] modif: rlimit: allow uppercase suffixes (#6890) For better usability and because the proper suffixes (KiB, MiB and GiB) are uppercase. Affected commands: * `rlimit-as` * `rlimit-fsize` Before: $ firejail --quiet --noprofile --rlimit-as=100m /bin/true $ firejail --quiet --noprofile --rlimit-as=100M /bin/true Error: invalid rlimit-as. Only use positive numbers and k, m or g suffix.: No such file or directory After: $ firejail --quiet --noprofile --rlimit-as=100m /bin/true $ firejail --quiet --noprofile --rlimit-as=100M /bin/true Relates to #4315. --- src/firejail/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/firejail/util.c b/src/firejail/util.c index 6dc75a6d3..6e5c160e0 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c @@ -51,6 +51,7 @@ long long unsigned parse_arg_size(char *str) { sscanf(str, "%llu", &result); char suffix = *(str + len - 1); + suffix = tolower((unsigned char)suffix); if (!isdigit(suffix) && (suffix == 'k' || suffix == 'm' || suffix == 'g')) { len -= 1; }