summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libutil/login_class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c
index d54b30140e0b..d952940f6008 100644
--- a/lib/libutil/login_class.c
+++ b/lib/libutil/login_class.c
@@ -525,7 +525,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in
/*
* Now, we repeat some of the above for the user's private entries
*/
- if ((lc = login_getuserclass(pwd)) != NULL) {
+ if (getuid() == uid && (lc = login_getuserclass(pwd)) != NULL) {
mymask = setlogincontext(lc, pwd, mymask, flags);
login_close(lc);
}