diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-08-15 20:32:22 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-08-15 20:32:22 +0000 |
commit | a1ee01486d4d2da0dce2fd97a58ca548a402d598 (patch) | |
tree | eb06f4625b973fc701bb62d6902e4f1eb40bb4f2 /sys/kern/kern_resource.c | |
parent | 1a3299929d48eae52404e0b75267c111d07d2af4 (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/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |