From owner-svn-src-all@FreeBSD.ORG Fri Apr 12 14:19:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5C2AC05; Fri, 12 Apr 2013 14:19:44 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8297A2F; Fri, 12 Apr 2013 14:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3CEJicY029487; Fri, 12 Apr 2013 14:19:44 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3CEJisX029486; Fri, 12 Apr 2013 14:19:44 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201304121419.r3CEJisX029486@svn.freebsd.org> From: Pietro Cerutti Date: Fri, 12 Apr 2013 14:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249404 - head/usr.bin/at X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 12 Apr 2013 14:19:44 -0000 Author: gahr (ports committer) Date: Fri Apr 12 14:19:44 2013 New Revision: 249404 URL: http://svnweb.freebsd.org/changeset/base/249404 Log: - Switch order of setting real uid and gid. If we set uid first, then we don't have enough privileges to set gid. This looks like a long standing bug, just recently revealed by r241852. Approved by: cognet Modified: head/usr.bin/at/privs.h (contents, props changed) Modified: head/usr.bin/at/privs.h ============================================================================== --- head/usr.bin/at/privs.h Fri Apr 12 13:56:21 2013 (r249403) +++ head/usr.bin/at/privs.h Fri Apr 12 14:19:44 2013 (r249404) @@ -99,8 +99,8 @@ gid_t real_gid, effective_gid; PRIV_START \ effective_uid = (a); \ effective_gid = (b); \ - if (setreuid((uid_t)-1, effective_uid) != 0) err(1, "setreuid failed"); \ if (setregid((gid_t)-1, effective_gid) != 0) err(1, "setregid failed"); \ + if (setreuid((uid_t)-1, effective_uid) != 0) err(1, "setreuid failed"); \ PRIV_END \ } #endif