diff options
author | 2015-11-01 15:43:50 +0000 | |
---|---|---|
committer | 2015-11-01 15:43:50 +0000 | |
commit | d4839ae03c75c715d4ecedfe5ec7f4bfaa28210a (patch) | |
tree | 38474de206383bf6a7585bebf29696a1f4f914bc | |
parent | Add uses of areallocarray(). mksh and Bitrig ksh already have similar (diff) | |
download | wireguard-openbsd-d4839ae03c75c715d4ecedfe5ec7f4bfaa28210a.tar.xz wireguard-openbsd-d4839ae03c75c715d4ecedfe5ec7f4bfaa28210a.zip |
Do not need to check the pledge control bits for system calls that are
PLEDGE_ALWAYS.
ok semarie
-rw-r--r-- | sys/kern/kern_pledge.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index f7400532a46..b956f23c7a4 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.95 2015/11/01 13:01:58 semarie Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.96 2015/11/01 15:43:50 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -533,7 +533,7 @@ pledge_check(struct proc *p, int code, int *tval) if (code < 0 || code > SYS_MAXSYSCALL - 1) return (EINVAL); - if ((p->p_p->ps_pledge == 0) && (pledge_syscalls[code] == PLEDGE_ALWAYS)) + if (pledge_syscalls[code] == PLEDGE_ALWAYS) return (0); if (p->p_p->ps_pledge & pledge_syscalls[code]) |