From: Karel Zak Date: Thu, 18 Mar 2021 09:23:36 +0000 (+0100) Subject: prlimit: fix optional arguments parsing X-Git-Tag: v2.37-rc1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ad8db5521ec03d41a058674437f648d15ef8344;p=thirdparty%2Futil-linux.git prlimit: fix optional arguments parsing $ prlimit -f=100:100 failed to parse FSIZE limit Fixes: https://github.com/karelzak/util-linux/issues/1265 Signed-off-by: Karel Zak --- diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index c8c7d5c42c..18601efd30 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -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);