Date: Wed, 25 Aug 2010 21:32:08 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r211826 - head/sys/fs/unionfs Message-ID: <201008252132.o7PLW8j3023164@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008252132.o7PLW8j3023164>