diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -383,6 +383,11 @@ } +static const char * const inherit_enum[] = { + "inherit", + NULL +}; + /* * Private function setting umask from the login class. */ @@ -394,7 +399,13 @@ * indicating no specification. */ const rlim_t def_val = INT64_MIN + 1, err_val = INT64_MIN; - const rlim_t val = login_getcapnum(lc, "umask", def_val, err_val); + rlim_t val; + + if (login_getcapenum(lc, "umask", inherit_enum) == 0) + /* Found "inherit". */ + return; + + val = login_getcapnum(lc, "umask", def_val, err_val); if (val != def_val) { if (val < 0 || val > UINT16_MAX)