diff options
author | 2018-11-20 08:12:26 +0000 | |
---|---|---|
committer | 2018-11-20 08:12:26 +0000 | |
commit | f56dcaa1c17cc1485fbe8b8ff2995018f9a6bd12 (patch) | |
tree | 22b52af49ab8d4ce9cf42711764e419ad8f16dde | |
parent | Saw a mention somewhere a while back that the gotdata() function in (diff) | |
download | wireguard-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.c | 7 |
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; |