From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 21:32:09 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 236711065670; Wed, 25 Aug 2010 21:32:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12BEB8FC0C; Wed, 25 Aug 2010 21:32:09 +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 o7PLW8b2023166; Wed, 25 Aug 2010 21:32:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PLW8j3023164; Wed, 25 Aug 2010 21:32:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201008252132.o7PLW8j3023164@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 25 Aug 2010 21:32:08 +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: r211826 - head/sys/fs/unionfs 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: Wed, 25 Aug 2010 21:32:09 -0000 Author: trasz Date: Wed Aug 25 21:32:08 2010 New Revision: 211826 URL: http://svn.freebsd.org/changeset/base/211826 Log: Revert r210194, adding a comment explaining why calls to chgproccnt() in unionfs are actually needed. I have a better fix in trasz_hrl p4 branch, but now is not a good moment to commit it. Reported by: Alex Kozlov Modified: head/sys/fs/unionfs/union_subr.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Wed Aug 25 21:13:23 2010 (r211825) +++ head/sys/fs/unionfs/union_subr.c Wed Aug 25 21:32:08 2010 (r211826) @@ -775,6 +775,11 @@ unionfs_mkshadowdir(struct unionfs_mount /* Authority change to root */ rootinfo = uifind((uid_t)0); cred = crdup(cnp->cn_cred); + /* + * The calls to chgproccnt() are needed to compensate for change_ruid() + * calling chgproccnt(). + */ + chgproccnt(cred->cr_ruidinfo, 1, 0); change_euid(cred, rootinfo); change_ruid(cred, rootinfo); change_svuid(cred, (uid_t)0); @@ -824,6 +829,7 @@ unionfs_mkshadowdir_free_out: unionfs_mkshadowdir_abort: cnp->cn_cred = credbk; + chgproccnt(cred->cr_ruidinfo, -1, 0); crfree(cred); return (error);