From: Alejandro Colomar Date: Tue, 9 Jan 2024 19:03:58 +0000 (+0100) Subject: lib/limits.c: setup_limits(): Simplify, by calling str2i(mode_t, ) instead of str2ul() X-Git-Tag: 4.17.0-rc1~160 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03521bcccec87e92869948632e9df4e2624f9a78;p=thirdparty%2Fshadow.git lib/limits.c: setup_limits(): Simplify, by calling str2i(mode_t, ) instead of str2ul() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- diff --git a/lib/limits.c b/lib/limits.c index 6d3a3037c..6c1a97f63 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -507,10 +507,9 @@ void setup_limits (const struct passwd *info) continue; } if (strncmp (cp, "umask=", 6) == 0) { - unsigned long mask; + mode_t mask; - if ( (str2ul(&mask, cp + 6) == -1) - || (mask != (mode_t) mask)) { + if (str2i(mode_t, &mask, cp + 6) == -1) { SYSLOG ((LOG_WARN, "Can't set umask value for user %s", info->pw_name));