aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/unionfs
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2010-08-25 21:32:08 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2010-08-25 21:32:08 +0000
commit81f6480d42b7f4ee008398fcc839c489bc1a140f (patch)
tree07d741feae3938787844602dd8ca4e38416bcd09 /sys/fs/unionfs
parentdb1cea00adfce315c94c26966f56e7ec3977f624 (diff)
Notes
Diffstat (limited to 'sys/fs/unionfs')
-rw-r--r--sys/fs/unionfs/union_subr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index dbed54e6298ea..2e74844d4d474 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -775,6 +775,11 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp,
/* 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);