From owner-svn-src-all@FreeBSD.ORG Fri Sep 24 23:51:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC0C106564A; Fri, 24 Sep 2010 23:51:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF648FC08; Fri, 24 Sep 2010 23:51:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ONpjhx043279; Fri, 24 Sep 2010 23:51:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ONpjEr043277; Fri, 24 Sep 2010 23:51:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201009242351.o8ONpjEr043277@svn.freebsd.org> From: Xin LI Date: Fri, 24 Sep 2010 23:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213146 - stable/6/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 23:51:45 -0000 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); }