aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil/login_class.c
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2012-02-09 21:06:47 +0000
committerEitan Adler <eadler@FreeBSD.org>2012-02-09 21:06:47 +0000
commit0bdc3ecf11021e29596957343ea097ab8210296d (patch)
tree7d9d08352dfc99c59d02f30c621e4d25e0504f0f /lib/libutil/login_class.c
parent839a18b056ddca32a4063437c56d7456f59398e6 (diff)
Notes
Diffstat (limited to 'lib/libutil/login_class.c')
-rw-r--r--lib/libutil/login_class.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c
index 68fdf2b49ff75..263044f446a93 100644
--- a/lib/libutil/login_class.c
+++ b/lib/libutil/login_class.c
@@ -452,18 +452,21 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in
p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p;
if (rtprio(RTP_SET, 0, &rtp))
syslog(LOG_WARNING, "rtprio '%s' (%s): %m",
- pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS);
+ pwd ? pwd->pw_name : "-",
+ lc ? lc->lc_class : LOGIN_DEFCLASS);
} else if (p < PRIO_MIN) {
rtp.type = RTP_PRIO_REALTIME;
rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX);
p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p;
if (rtprio(RTP_SET, 0, &rtp))
syslog(LOG_WARNING, "rtprio '%s' (%s): %m",
- pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS);
+ pwd ? pwd->pw_name : "-",
+ lc ? lc->lc_class : LOGIN_DEFCLASS);
} else {
if (setpriority(PRIO_PROCESS, 0, (int)p) != 0)
syslog(LOG_WARNING, "setpriority '%s' (%s): %m",
- pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS);
+ pwd ? pwd->pw_name : "-",
+ lc ? lc->lc_class : LOGIN_DEFCLASS);
}
}