]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/limits.c: setup_limits(): Simplify, by calling str2si() instead of str2sl()
authorAlejandro Colomar <alx@kernel.org>
Tue, 9 Jan 2024 19:03:33 +0000 (20:03 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 2 Jul 2024 20:52:31 +0000 (22:52 +0200)
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/limits.c

index 636d087d315523c5f63fd8a1deb82bebb245c7b6..6d3a3037c93e6af7b82e9a572c5c314f8e793c40 100644 (file)
@@ -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",