mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
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.
This commit is contained in:
parent
920917b978
commit
7f712264ec
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue