lib/limits.c: setup_limits(): Simplify, by calling str2i(mode_t, ) instead of str2ul()

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-01-09 20:03:58 +01:00
parent 3fd1d62e29
commit 03521bccce

View File

@@ -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));