diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2009-10-31 12:00:09 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2009-10-31 12:00:09 +0000 |
commit | 04783f7109699fb1efc94f9822ac1e849dc0b7ff (patch) | |
tree | 11514d25f29a5322b91cbc57e3b913945809976a /sys/ufs/ext2fs | |
parent | 4a9bd3706fe9ef219f0658e9acc9ab43b2bfd422 (diff) |
Use suser when possible. Suggested by miod@.
miod@ deraadt@ ok.
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 2e2ce764eaf..f75ad09be2c 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.53 2009/07/09 22:29:56 thib Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.54 2009/10/31 12:00:08 fgsch Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -220,7 +220,7 @@ ext2fs_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) != 0) { devvp = ump->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, VREAD | VWRITE, @@ -267,7 +267,7 @@ ext2fs_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) != 0) { accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; |