From 03521bcccec87e92869948632e9df4e2624f9a78 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 9 Jan 2024 20:03:58 +0100 Subject: [PATCH] lib/limits.c: setup_limits(): Simplify, by calling str2i(mode_t, ) instead of str2ul() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- lib/limits.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/limits.c b/lib/limits.c index 6d3a3037..6c1a97f6 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));