diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-11-30 17:01:18 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-11-30 17:01:18 +0000 |
commit | 797ffd8c007bfc1e867da0c8b51e9303a02f6178 (patch) | |
tree | a77df0ee55a1fc8e4c484d0dcc1387ac79a4e9b3 /sys/ufs/ffs | |
parent | a97df7065bc3774331b7dea25b04cb5712a09045 (diff) |
Use suser() to check for root privileges, okay hshoexer@ deraadt@
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 557b3f15a03..fe54fa0b9e7 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.75 2005/11/30 10:35:08 pedro Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.76 2005/11/30 17:01:17 pedro Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -259,7 +259,7 @@ ffs_mount(struct mount *mp, const char *path, void *data, * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. */ - if (p->p_ucred->cr_uid != 0) { + if (suser(p, 0)) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, VREAD | VWRITE, p->p_ucred, p); @@ -343,7 +343,7 @@ ffs_mount(struct mount *mp, const char *path, void *data, * If mount by non-root, then verify that user has necessary * permissions on the device. */ - if (p->p_ucred->cr_uid != 0) { + if (suser(p, 0)) { accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; |