]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
prlimit: fix optional arguments parsing
authorKarel Zak <kzak@redhat.com>
Thu, 18 Mar 2021 09:23:36 +0000 (10:23 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Mar 2021 09:23:36 +0000 (10:23 +0100)
 $ prlimit -f=100:100
 failed to parse FSIZE limit

Fixes: https://github.com/karelzak/util-linux/issues/1265
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/prlimit.c

index c8c7d5c42c164b3bbe60824c4ebc1673fd4b4d35..18601efd304b491dbd7958fbef2bbd7ac61a5bdf 100644 (file)
@@ -453,6 +453,9 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id)
        rlim_t soft, hard;
        int found = 0;
 
+       if (ops && *ops == '=')
+               ops++;
+
        if (get_range(ops, &soft, &hard, &found))
                errx(EXIT_FAILURE, _("failed to parse %s limit"),
                     prlimit_desc[id].name);