diff options
Diffstat (limited to 'bin/ksh/misc.c')
-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; |