--- lib/libutil/login_class.c.orig
+++ lib/libutil/login_class.c
@@ -546,7 +546,7 @@
     /*
      * Now, we repeat some of the above for the user's private entries
      */
-    if (getuid() == uid && (lc = login_getuserclass(pwd)) != NULL) {
+    if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) {
 	mymask = setlogincontext(lc, pwd, mymask, flags);
 	login_close(lc);
     }
