From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 11:32:20 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 9B454106566C; Mon, 16 Aug 2010 11:32:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5528FC0A; Mon, 16 Aug 2010 11:32:20 +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 o7GBWKwo097185; Mon, 16 Aug 2010 11:32:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GBWKhx097183; Mon, 16 Aug 2010 11:32:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008161132.o7GBWKhx097183@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 16 Aug 2010 11:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211393 - head/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: Mon, 16 Aug 2010 11:32:20 -0000 Author: des Date: Mon Aug 16 11:32:20 2010 New Revision: 211393 URL: http://svn.freebsd.org/changeset/base/211393 Log: 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. MFC after: 3 weeks Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Aug 16 11:22:12 2010 (r211392) +++ head/lib/libutil/login_class.c Mon Aug 16 11:32:20 2010 (r211393) @@ -525,7 +525,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); }