summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
commita1ee01486d4d2da0dce2fd97a58ca548a402d598 (patch)
treeeb06f4625b973fc701bb62d6902e4f1eb40bb4f2 /sys/kern
parent1a3299929d48eae52404e0b75267c111d07d2af4 (diff)
change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_acct.c4
-rw-r--r--sys/kern/kern_descrip.c4
-rw-r--r--sys/kern/kern_event.c5
-rw-r--r--sys/kern/kern_prot.c55
-rw-r--r--sys/kern/kern_resource.c6
-rw-r--r--sys/kern/kern_sig.c4
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/kern/kern_time.c10
-rw-r--r--sys/kern/kern_xxx.c4
-rw-r--r--sys/kern/sys_process.c4
-rw-r--r--sys/kern/tty.c4
-rw-r--r--sys/kern/vfs_syscalls.c44
12 files changed, 79 insertions, 69 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 9d807c881af..36d1aba3f65 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.11 2003/06/02 23:28:05 millert Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.12 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -106,7 +106,7 @@ sys_acct(p, v, retval)
int error;
/* Make sure that the caller is root. */
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
/*
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 2a663bedd39..83c1a8b03fe 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.64 2003/08/06 20:37:38 millert Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.65 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -613,7 +613,7 @@ sys_fstat(p, v, retval)
if (error == 0) {
/* Don't let non-root see generation numbers
(for NFS security) */
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
ub.st_gen = 0;
error = copyout((caddr_t)&ub, (caddr_t)SCARG(uap, sb),
sizeof (ub));
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 91cb9d260a5..b5d265159d7 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.19 2003/06/27 16:20:58 nate Exp $ */
+/* $OpenBSD: kern_event.c,v 1.20 2003/08/15 20:32:18 tedu Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -195,8 +195,7 @@ filt_procattach(struct knote *kn)
* setuid/setgid privs (unless you're root).
*/
if ((p->p_cred->p_ruid != curproc->p_cred->p_ruid ||
- (p->p_flag & P_SUGID)) &&
- suser(curproc->p_ucred, &curproc->p_acflag) != 0)
+ (p->p_flag & P_SUGID)) && suser(curproc, 0) != 0)
return (EACCES);
kn->kn_ptr.p_proc = p;
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 0bb0244cd6e..08d997605bd 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.24 2003/06/02 23:28:05 millert Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.25 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -383,21 +383,21 @@ sys_setresuid(p, v, retval)
ruid != pc->p_ruid &&
ruid != pc->pc_ucred->cr_uid &&
ruid != pc->p_svuid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
if (euid != (uid_t)-1 &&
euid != pc->p_ruid &&
euid != pc->pc_ucred->cr_uid &&
euid != pc->p_svuid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
if (suid != (uid_t)-1 &&
suid != pc->p_ruid &&
suid != pc->pc_ucred->cr_uid &&
suid != pc->p_svuid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
@@ -489,21 +489,21 @@ sys_setresgid(p, v, retval)
rgid != pc->p_rgid &&
rgid != pc->pc_ucred->cr_gid &&
rgid != pc->p_svgid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
if (egid != (gid_t)-1 &&
egid != pc->p_rgid &&
egid != pc->pc_ucred->cr_gid &&
egid != pc->p_svgid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
if (sgid != (gid_t)-1 &&
sgid != pc->p_rgid &&
sgid != pc->pc_ucred->cr_gid &&
sgid != pc->p_svgid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
@@ -616,14 +616,14 @@ sys_setuid(p, v, retval)
if (uid != pc->p_ruid &&
uid != pc->p_svuid &&
uid != pc->pc_ucred->cr_uid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
* Everything's okay, do it.
*/
if (uid == pc->pc_ucred->cr_uid ||
- suser(pc->pc_ucred, &p->p_acflag) == 0) {
+ suser(p, 0) == 0) {
/*
* Transfer proc count to new user.
*/
@@ -664,7 +664,7 @@ sys_seteuid(p, v, retval)
return (0);
if (euid != pc->p_ruid && euid != pc->p_svuid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
@@ -700,11 +700,11 @@ sys_setgid(p, v, retval)
if (gid != pc->p_rgid &&
gid != pc->p_svgid &&
gid != pc->pc_ucred->cr_gid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
if (gid == pc->pc_ucred->cr_gid ||
- suser(pc->pc_ucred, &p->p_acflag) == 0) {
+ suser(p, 0) == 0) {
pc->p_rgid = gid;
pc->p_svgid = gid;
}
@@ -738,7 +738,7 @@ sys_setegid(p, v, retval)
return (0);
if (egid != pc->p_rgid && egid != pc->p_svgid &&
- (error = suser(pc->pc_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
@@ -765,7 +765,7 @@ sys_setgroups(p, v, retval)
u_int ngrp;
int error;
- if ((error = suser(pc->pc_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
ngrp = SCARG(uap, gidsetsize);
if (ngrp > NGROUPS)
@@ -799,25 +799,34 @@ groupmember(gid, cred)
}
/*
- * Test whether the specified credentials imply "super-user"
- * privilege; if so, and we have accounting info, set the flag
- * indicating use of super-powers.
+ * Test whether this process has special user powers.
* Returns 0 or error.
*/
int
-suser(cred, acflag)
- struct ucred *cred;
- u_short *acflag;
+suser(struct proc *p, u_int flags)
{
+ struct ucred *cred = p->p_ucred;
+
if (cred->cr_uid == 0) {
- if (acflag)
- *acflag |= ASU;
+ if (!(flags & SUSER_NOACCT))
+ p->p_acflag |= ASU;
return (0);
}
return (EPERM);
}
/*
+ * replacement for old suser, for callers who don't have a process
+ */
+int
+suser_ucred(struct ucred *cred)
+{
+ if (cred->cr_uid == 0)
+ return (0);
+ return (EPERM);
+}
+
+/*
* Allocate a zeroed cred structure.
*/
struct ucred *
@@ -913,7 +922,7 @@ sys_setlogin(p, v, retval)
} */ *uap = v;
int error;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
error = copyinstr((caddr_t) SCARG(uap, namebuf),
(caddr_t) p->p_pgrp->pg_session->s_login,
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 980c4057e0d..272cab6aad3 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.22 2003/06/02 23:28:05 millert Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.23 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -194,7 +194,7 @@ donice(curp, chgp, n)
if (n < PRIO_MIN)
n = PRIO_MIN;
n += NZERO;
- if (n < chgp->p_nice && suser(pcred->pc_ucred, &curp->p_acflag))
+ if (n < chgp->p_nice && suser(curp, 0))
return (EACCES);
chgp->p_nice = n;
(void)resetpriority(chgp);
@@ -241,7 +241,7 @@ dosetrlimit(p, which, limp)
alimp = &p->p_rlimit[which];
if (limp->rlim_cur > alimp->rlim_max ||
limp->rlim_max > alimp->rlim_max)
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
if (p->p_limit->p_refcnt > 1 &&
(p->p_limit->p_lflags & PL_SHAREMOD) == 0) {
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 2fbd6b040cb..3a34b4d953f 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.66 2003/08/04 16:27:01 millert Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.67 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1290,7 +1290,7 @@ coredump(p)
* group privileges.
*/
if ((p->p_flag & P_SUGID) &&
- (error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ (error = suser(p, 0)) != 0)
return (error);
if ((p->p_flag & P_SUGID) && nosuidcoredump)
return (EPERM);
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 030f5ba1157..a15d511470b 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.84 2003/08/06 21:08:07 millert Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.85 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -134,7 +134,7 @@ sys___sysctl(p, v, retval)
int name[CTL_MAXNAME];
if (SCARG(uap, new) != NULL &&
- (error = suser(p->p_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
return (error);
/*
* all top-level sysctl names are non-terminal
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 02ab73c593a..8dc5399a4e6 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.35 2003/08/11 05:38:05 kevlo Exp $ */
+/* $OpenBSD: kern_time.c,v 1.36 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -158,7 +158,7 @@ sys_clock_settime(p, v, retval)
struct timespec ats;
int error;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
clock_id = SCARG(uap, clock_id);
@@ -177,6 +177,8 @@ sys_clock_settime(p, v, retval)
if ((error = copyin(SCARG(uap, tp), &ats, sizeof(ats))) != 0)
return (error);
+ TIMESPEC_TO_TIMEVAL(&atv,&ats);
+
return (0);
}
@@ -319,7 +321,7 @@ sys_settimeofday(p, v, retval)
struct timezone atz;
int error;
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p, 0)))
return (error);
/* Verify all parameters before changing time. */
if (SCARG(uap, tv) && (error = copyin((void *)SCARG(uap, tv),
@@ -356,7 +358,7 @@ sys_adjtime(p, v, retval)
register long ndelta, ntickdelta, odelta;
int s, error;
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p, 0)))
return (error);
if ((error = copyin((void *)SCARG(uap, delta), (void *)&atv,
sizeof(struct timeval))))
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c
index 7c5fc527ad6..978fd141bf3 100644
--- a/sys/kern/kern_xxx.c
+++ b/sys/kern/kern_xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_xxx.c,v 1.8 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.9 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
@@ -54,7 +54,7 @@ sys_reboot(p, v, retval)
} */ *uap = v;
int error;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
boot(SCARG(uap, opt));
return (0);
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 51111f3dd7a..7646bea1a26 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.25 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: sys_process.c,v 1.26 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -142,7 +142,7 @@ sys_ptrace(p, v, retval)
if ((t->p_cred->p_ruid != p->p_cred->p_ruid ||
ISSET(t->p_flag, P_SUGIDEXEC) ||
ISSET(t->p_flag, P_SUGID)) &&
- (error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ (error = suser(p, 0)) != 0)
return (error);
/*
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index ae7a047000d..bc808a570e5 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.58 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: tty.c,v 1.59 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -845,7 +845,7 @@ ttioctl(tp, cmd, data, flag, p)
*(struct winsize *)data = tp->t_winsize;
break;
case TIOCGPGRP: /* get pgrp of tty */
- if (!isctty(p, tp) && suser(p->p_ucred, &p->p_acflag))
+ if (!isctty(p, tp) && suser(p, 0))
return (ENOTTY);
*(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
break;
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 4b2129ede8d..a99d658045d 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.105 2003/07/18 16:43:32 tedu Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.106 2003/08/15 20:32:18 tedu Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -108,7 +108,7 @@ sys_mount(p, v, retval)
struct vfsconf *vfsp;
struct timeval tv;
- if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag)))
+ if (usermount == 0 && (error = suser(p, 0)))
return (error);
/*
@@ -148,7 +148,7 @@ sys_mount(p, v, retval)
* permitted to update it.
*/
if (mp->mnt_stat.f_owner != p->p_ucred->cr_uid &&
- (error = suser(p->p_ucred, &p->p_acflag))) {
+ (error = suser(p, 0))) {
vput(vp);
return (error);
}
@@ -176,7 +176,7 @@ sys_mount(p, v, retval)
*/
if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)) ||
(va.va_uid != p->p_ucred->cr_uid &&
- (error = suser(p->p_ucred, &p->p_acflag)))) {
+ (error = suser(p, 0)))) {
vput(vp);
return (error);
}
@@ -397,7 +397,7 @@ sys_unmount(p, v, retval)
* permitted to unmount this filesystem.
*/
if ((mp->mnt_stat.f_owner != p->p_ucred->cr_uid) &&
- (error = suser(p->p_ucred, &p->p_acflag))) {
+ (error = suser(p, 0))) {
vput(vp);
return (error);
}
@@ -600,7 +600,7 @@ sys_statfs(p, v, retval)
sp->f_eflags = STATFS_SOFTUPD;
#endif
/* Don't let non-root see filesystem id (for NFS security) */
- if (suser(p->p_ucred, &p->p_acflag)) {
+ if (suser(p, 0)) {
bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
sp = &sb;
@@ -646,7 +646,7 @@ sys_fstatfs(p, v, retval)
sp->f_eflags = STATFS_SOFTUPD;
#endif
/* Don't let non-root see filesystem id (for NFS security) */
- if (suser(p->p_ucred, &p->p_acflag)) {
+ if (suser(p, 0)) {
bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
sp = &sb;
@@ -705,7 +705,7 @@ sys_getfsstat(p, v, retval)
if (mp->mnt_flag & MNT_SOFTDEP)
sp->f_eflags = STATFS_SOFTUPD;
#endif
- if (suser(p->p_ucred, &p->p_acflag)) {
+ if (suser(p, 0)) {
bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
sp = &sb;
@@ -823,7 +823,7 @@ sys_chroot(p, v, retval)
int error;
struct nameidata nd;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
@@ -994,7 +994,7 @@ sys_getfh(p, v, retval)
/*
* Must be super user
*/
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
@@ -1043,7 +1043,7 @@ sys_fhopen(p, v, retval)
/*
* Must be super user
*/
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p, 0)))
return (error);
flags = FFLAGS(SCARG(uap, flags));
@@ -1162,7 +1162,7 @@ sys_fhstat(p, v, retval)
/*
* Must be super user
*/
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p, 0)))
return (error);
if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
@@ -1200,7 +1200,7 @@ sys_fhstatfs(p, v, retval)
/*
* Must be super user
*/
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p, 0)))
return (error);
if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
@@ -1239,7 +1239,7 @@ sys_mknod(p, v, retval)
int whiteout = 0;
struct nameidata nd;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
if (p->p_fd->fd_rdir)
return (EINVAL);
@@ -1654,7 +1654,7 @@ sys_stat(p, v, retval)
if (error)
return (error);
/* Don't let non-root see generation numbers (for NFS security) */
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
sb.st_gen = 0;
error = copyout((caddr_t)&sb, (caddr_t)SCARG(uap, ub), sizeof (sb));
return (error);
@@ -1687,7 +1687,7 @@ sys_lstat(p, v, retval)
if (error)
return (error);
/* Don't let non-root see generation numbers (for NFS security) */
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
sb.st_gen = 0;
error = copyout((caddr_t)&sb, (caddr_t)SCARG(uap, ub), sizeof (sb));
return (error);
@@ -1794,7 +1794,7 @@ sys_chflags(p, v, retval)
else if (SCARG(uap, flags) == VNOVAL)
error = EINVAL;
else {
- if (suser(p->p_ucred, &p->p_acflag)) {
+ if (suser(p, 0)) {
if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
goto out;
if (vattr.va_type == VCHR || vattr.va_type == VBLK) {
@@ -1840,7 +1840,7 @@ sys_fchflags(p, v, retval)
else if (SCARG(uap, flags) == VNOVAL)
error = EINVAL;
else {
- if (suser(p->p_ucred, &p->p_acflag)) {
+ if (suser(p, 0)) {
if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
!= 0)
goto out;
@@ -1968,7 +1968,7 @@ sys_chown(p, v, retval)
error = EROFS;
else {
if ((SCARG(uap, uid) != -1 || SCARG(uap, gid) != -1) &&
- (suser(p->p_ucred, &p->p_acflag) || suid_clear)) {
+ (suser(p, 0) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
@@ -2020,7 +2020,7 @@ sys_lchown(p, v, retval)
error = EROFS;
else {
if ((SCARG(uap, uid) != -1 || SCARG(uap, gid) != -1) &&
- (suser(p->p_ucred, &p->p_acflag) || suid_clear)) {
+ (suser(p, 0) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
@@ -2071,7 +2071,7 @@ sys_fchown(p, v, retval)
error = EROFS;
else {
if ((SCARG(uap, uid) != -1 || SCARG(uap, gid) != -1) &&
- (suser(p->p_ucred, &p->p_acflag) || suid_clear)) {
+ (suser(p, 0) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
@@ -2629,7 +2629,7 @@ sys_revoke(p, v, retval)
if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
goto out;
if (p->p_ucred->cr_uid != vattr.va_uid &&
- (error = suser(p->p_ucred, &p->p_acflag)))
+ (error = suser(p, 0)))
goto out;
if (vp->v_usecount > 1 || (vp->v_flag & (VALIASED | VLAYER)))
VOP_REVOKE(vp, REVOKEALL);