summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-08-03 17:07:04 +0000
committerimp <imp@FreeBSD.org>1999-08-03 17:07:04 +0000
commit9e1a007dbf407fe2b5b22c6416a08a5b7656369a (patch)
tree3542eb7e0b9f624e53952ab2fb278f7c7ab18060 /sys/kern/vfs_syscalls.c
parent054c42cb509cf32ba47f0b1305025ea83ca48b1d (diff)
downloadFreeBSD-src-9e1a007dbf407fe2b5b22c6416a08a5b7656369a.zip
FreeBSD-src-9e1a007dbf407fe2b5b22c6416a08a5b7656369a.tar.gz
brucify:
o use suser_xxx rather than suser to support JAIL code. o KNF comment convention o use vp->type rather than vaddr.type and eliminate call to VOP_GETATTR. Bruce says that vp->type is valid at this point. Submitted by: bde. Not fixed: o return (value) o Comment needs to be longer and more explicit. It will be after the advisory.
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index a1674d8..cf096f1 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.125 1999/07/29 17:02:56 green Exp $
+ * $Id: vfs_syscalls.c,v 1.126 1999/08/02 21:34:46 imp Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -1892,13 +1892,13 @@ setfflags(p, vp, flags)
int error;
struct vattr vattr;
- if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)))
- return error;
/*
- * Don't allow setting of flags on devices for nonroot users
+ * Don't allow setting of flags on devices for non-root users.
*/
- if ((vattr.va_type == VCHR || vattr.va_type == VBLK) && suser(p))
- return 0;
+ if ((vp->va_type == VCHR || vp->va_type == VBLK) &&
+ (error = suser_xxx(p->ucred, p, PRISON_ROOT)))
+ return error;
+
VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
VATTR_NULL(&vattr);
OpenPOWER on IntegriCloud