diff options
author | John Baldwin <jhb@FreeBSD.org> | 2002-02-27 19:15:29 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2002-02-27 19:15:29 +0000 |
commit | bdd67d483cbcacdc50ced5ab3c25bacc3cb337ec (patch) | |
tree | f7667a91cdb42885bddbed430d30dc655811b45d /sys/kern/vfs_extattr.c | |
parent | 6f105b344469af92709bb97135d70a29a942ece4 (diff) | |
download | src-bdd67d483cbcacdc50ced5ab3c25bacc3cb337ec.tar.gz src-bdd67d483cbcacdc50ced5ab3c25bacc3cb337ec.zip |
- Change namei() to use td_ucred instead of p_ucred.
- Change the hack in access() that uses a temporary credential to set
td_ucred to the temp cred instead of p_ucred.
Notes
Notes:
svn path=/head/; revision=91419
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r-- | sys/kern/vfs_extattr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 7cb7f1546353..8e98fcd33f69 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -1838,7 +1838,6 @@ access(td, uap) int error; struct nameidata nd; - cred = td->td_proc->p_ucred; /* * Create and modify a temporary credential instead of one that * is potentially shared. This could also mess up socket @@ -1848,10 +1847,11 @@ access(td, uap) * may be better to explicitly pass the credential to namei() * rather than to modify the potentially shared process structure. */ + cred = td->td_ucred; tmpcred = crdup(cred); tmpcred->cr_uid = cred->cr_ruid; tmpcred->cr_groups[0] = cred->cr_rgid; - td->td_proc->p_ucred = tmpcred; + td->td_ucred = tmpcred; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) @@ -1862,7 +1862,7 @@ access(td, uap) NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); out1: - td->td_proc->p_ucred = cred; + td->td_ucred = cred; crfree(tmpcred); return (error); } |