diff options
| -rw-r--r-- | lib/libutil/login_class.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9d8dc652d678..f545e3661520 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -463,9 +463,15 @@ static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + rlim_t p; int rc; + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "priority", inherit_enum) == 0) + return; + + p = login_getcapnum(lc, "priority", def_val, err_val); + if (p == err_val) { /* Invariant: 'lc' != NULL. */ syslog(LOG_WARNING, |
