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/kern/vfs_syscalls.c | |
parent | 4a9bd3706fe9ef219f0658e9acc9ab43b2bfd422 (diff) |
Use suser when possible. Suggested by miod@.
miod@ deraadt@ ok.
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index c62696f00ab..7ff15ffa10c 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.158 2009/09/08 17:41:20 miod Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.159 2009/10/31 12:00:08 fgsch Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -145,7 +145,7 @@ sys_mount(struct proc *p, void *v, register_t *retval) * enforce MNT_NOSUID and MNT_NODEV for non-root users, and * inherit MNT_NOEXEC from the mount point. */ - if (p->p_ucred->cr_uid != 0) { + if (suser(p, 0) != 0) { if (SCARG(uap, flags) & MNT_EXPORTED) { vput(vp); return (EPERM); @@ -176,7 +176,7 @@ sys_mount(struct proc *p, void *v, register_t *retval) * enforce MNT_NOSUID and MNT_NODEV for non-root users, and inherit * MNT_NOEXEC from the mount point. */ - if (p->p_ucred->cr_uid != 0) { + if (suser(p, 0) != 0) { if (SCARG(uap, flags) & MNT_EXPORTED) { vput(vp); return (EPERM); |