summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2018-11-20 08:12:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2018-11-20 08:12:27 +0000
commit6a51f64dbd8cc90d151935e0083939078871611a (patch)
tree12db7238e4621c94b2d8dcd20d5269eee3cd2fbf
parent69280411703a16696c1e205e1f2bb2615facbc64 (diff)
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;