diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
commit | b6baa60b1e807d09641c20b2ff1fe838ddebbd3b (patch) | |
tree | 81781cbbf3ad98f73e64d11188dfe3084b844e12 /sys/compat/svr4/svr4_misc.c | |
parent | 0c5b7b7672ac24978496b6d8b72a9f4c74349b64 (diff) | |
download | FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.zip FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.tar.gz |
Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
Diffstat (limited to 'sys/compat/svr4/svr4_misc.c')
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 62d0da9..b976c2d 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -250,7 +250,6 @@ svr4_sys_getdents64(p, uap) struct uio auio; struct iovec aiov; struct vattr va; - struct ucred *uc; off_t off; struct svr4_dirent64 svr4_dirent; int buflen, error, eofflag, nbytes, justone; @@ -271,13 +270,7 @@ svr4_sys_getdents64(p, uap) if (vp->v_type != VDIR) return (EINVAL); - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = VOP_GETATTR(vp, &va, uc, p); - crfree(uc); - if (error != 0) { + if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p))) { return error; } @@ -599,7 +592,6 @@ svr4_sys_fchroot(p, uap) struct filedesc *fdp = p->p_fd; struct vnode *vp; struct file *fp; - struct ucred *uc; int error; if ((error = suser(p)) != 0) @@ -610,14 +602,8 @@ svr4_sys_fchroot(p, uap) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); if (vp->v_type != VDIR) error = ENOTDIR; - else { - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); + else error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); - crfree(uc); - } VOP_UNLOCK(vp, 0, p); if (error) return error; |