summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-11-20 08:12:26 +0000
committerderaadt <deraadt@openbsd.org>2018-11-20 08:12:26 +0000
commitf56dcaa1c17cc1485fbe8b8ff2995018f9a6bd12 (patch)
tree22b52af49ab8d4ce9cf42711764e419ad8f16dde
parentSaw a mention somewhere a while back that the gotdata() function in (diff)
downloadwireguard-openbsd-f56dcaa1c17cc1485fbe8b8ff2995018f9a6bd12.tar.xz
wireguard-openbsd-f56dcaa1c17cc1485fbe8b8ff2995018f9a6bd12.zip
Convert the pledge call to idiomatic format 'cause we love grep.
-rw-r--r--bin/ksh/misc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 89d7860d965..6e04514161b 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.71 2018/11/16 06:41:58 nicm Exp $ */
+/* $OpenBSD: misc.c,v 1.72 2018/11/20 08:12:26 deraadt Exp $ */
/*
* Miscellaneous functions
@@ -299,8 +299,9 @@ change_flag(enum sh_flag f,
setgroups(1, &gid);
setresuid(ksheuid, ksheuid, ksheuid);
- pledge("stdio rpath wpath cpath fattr flock getpw proc "
- "exec tty", NULL);
+ if (pledge("stdio rpath wpath cpath fattr flock getpw proc "
+ "exec tty", NULL) == -1)
+ bi_errorf("pledge fail");
dropped_privileges = 1;
} else if (f == FPOSIX && newval) {
Flag(FBRACEEXPAND) = 0;