summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-08-13 20:31:38 +0000
committerderaadt <deraadt@openbsd.org>2018-08-13 20:31:38 +0000
commitee41fe2bb2c8bc9d81f39d8aac0222e6dcd3bf74 (patch)
tree76df49e1bdf17726e2d6a17ff2ca2c62529b5803
parentMake the owner of fcgi socket configurable. (diff)
downloadwireguard-openbsd-ee41fe2bb2c8bc9d81f39d8aac0222e6dcd3bf74.tar.xz
wireguard-openbsd-ee41fe2bb2c8bc9d81f39d8aac0222e6dcd3bf74.zip
The first panic in pledge_namei should only be for ni_pledge == 0
(the other cause is implausible, and crashes with a nice *NULL)
-rw-r--r--sys/kern/kern_pledge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c
index 546d9389ad4..659e789ba45 100644
--- a/sys/kern/kern_pledge.c
+++ b/sys/kern/kern_pledge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_pledge.c,v 1.240 2018/08/11 16:16:07 beck Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.241 2018/08/13 20:31:38 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -568,8 +568,8 @@ pledge_namei(struct proc *p, struct nameidata *ni, char *origpath)
(p->p_p->ps_flags & PS_COREDUMP))
return (0);
- if (!ni || (ni->ni_pledge == 0))
- panic("ni_pledge");
+ if (ni->ni_pledge == 0)
+ panic("pledge_namei: ni_pledge");
/*
* We set the BYPASSUNVEIL flag to skip unveil checks