From: Alejandro Colomar Date: Tue, 9 Jan 2024 19:03:33 +0000 (+0100) Subject: lib/limits.c: setup_limits(): Simplify, by calling str2si() instead of str2sl() X-Git-Tag: 4.17.0-rc1~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3fd1d62e29f714a7ee82d4e7ac0c7c8fac976871;p=thirdparty%2Fshadow.git lib/limits.c: setup_limits(): Simplify, by calling str2si() instead of str2sl() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- diff --git a/lib/limits.c b/lib/limits.c index 636d087d3..6d3a3037c 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -496,9 +496,9 @@ void setup_limits (const struct passwd *info) continue; } if (strncmp (cp, "ulimit=", 7) == 0) { - long blocks; - if ( (str2sl(&blocks, cp + 7) == -1) - || (blocks != (int) blocks) + int blocks; + + if ( (str2si(&blocks, cp + 7) == -1) || (set_filesize_limit (blocks) != 0)) { SYSLOG ((LOG_WARN, "Can't set the ulimit for user %s",