diff options
author | 2015-11-11 02:56:07 +0000 | |
---|---|---|
committer | 2015-11-11 02:56:07 +0000 | |
commit | 97dfd3568681960801ef8da32d987de0893bbceb (patch) | |
tree | 5910a1a6648bd53671c85172ce03735adf149e61 | |
parent | claudio twice told me pledge "stdio rpath dns" is probably enough. (diff) | |
download | wireguard-openbsd-97dfd3568681960801ef8da32d987de0893bbceb.tar.xz wireguard-openbsd-97dfd3568681960801ef8da32d987de0893bbceb.zip |
exit if pledge fails
-rw-r--r-- | usr.bin/less/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c index b9561c572d5..ff26accda7d 100644 --- a/usr.bin/less/main.c +++ b/usr.bin/less/main.c @@ -89,11 +89,15 @@ main(int argc, char *argv[]) secure = 1; if (secure) { - if (pledge("stdio rpath wpath tty", NULL) == -1) + if (pledge("stdio rpath wpath tty", NULL) == -1) { perror("pledge"); + exit(1); + } } else { - if (pledge("stdio rpath wpath cpath fattr proc exec tty", NULL) == -1) + if (pledge("stdio rpath wpath cpath fattr proc exec tty", NULL) == -1) { perror("pledge"); + exit(1); + } } /* @@ -222,8 +226,10 @@ main(int argc, char *argv[]) open_getchr(); if (secure) - if (pledge("stdio rpath tty", NULL) == -1) + if (pledge("stdio rpath tty", NULL) == -1) { perror("pledge"); + exit(1); + } raw_mode(1); init_signals(1); |