Author: delphij
Date: Fri Sep 24 23:51:45 2010
New Revision: 213146
URL: http://svn.freebsd.org/changeset/base/213146

Log:
  MFC r211393 (by des):
  
  In setusercontext(), do not apply user settings unless running as the
  user in question (usually but not necessarily because we were called
  with LOGIN_SETUSER).  This plugs a hole where users could raise their
  resource limits and expand their CPU mask.
  
  Approved by:  des

Modified:
  stable/6/lib/libutil/login_class.c
Directory Properties:
  stable/6/lib/libutil/   (props changed)

Modified: stable/6/lib/libutil/login_class.c
==============================================================================
--- stable/6/lib/libutil/login_class.c  Fri Sep 24 23:48:29 2010        
(r213145)
+++ stable/6/lib/libutil/login_class.c  Fri Sep 24 23:51:45 2010        
(r213146)
@@ -415,7 +415,7 @@ setusercontext(login_cap_t *lc, const st
     /*
      * 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);
     }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to