diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-11-01 19:03:34 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-11-01 19:03:34 +0000 |
commit | 68511280041637921c144dadc66364bd3847520e (patch) | |
tree | 8837690b527988d8389c4243559c191b02100459 /sys/kern/kern_sysctl.c | |
parent | b249aebdcb012545f1aa7bab683224c46dc508fc (diff) |
refactor pledge_*_check and pledge_fail functions
- rename _check function without suffix: a "pledge" function called from
anywhere is a "check" function.
- makes pledge_fail call the responsability to the _check function. remove it
from caller.
- make proper use of (potential) returned error of _check() functions.
- adds pledge_kill() and pledge_protexec()
with and OK deraadt@
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c76e623ca79..222bf4d89f9 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.297 2015/10/25 20:39:54 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.298 2015/11/01 19:03:33 semarie Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -174,10 +174,10 @@ sys_sysctl(struct proc *p, void *v, register_t *retval) if (error) return (error); - error = pledge_sysctl_check(p, SCARG(uap, namelen), + error = pledge_sysctl(p, SCARG(uap, namelen), name, SCARG(uap, new)); if (error) - return (pledge_fail(p, error, PLEDGE_STDIO)); + return (error); switch (name[0]) { case CTL_KERN: |