summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 02:52:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 02:52:47 +0000
commitfe9e8af8f3246e14a9eb585feb4d7f5aaa093855 (patch)
tree3281fbb5b5f5de11321c6825dd5a2c6d70e07068 /usr.sbin
parent0edf0956a8620a9cd461d3f081c92645c20c8b9e (diff)
exit() after perror() for pledge failure. Perhaps this got introduced
as a test idiom, either when pledge was young or during the transition to strings.... dunno
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bind/bin/dig/dig.c8
-rw-r--r--usr.sbin/bind/bin/dig/host.c8
-rw-r--r--usr.sbin/bind/bin/dig/nslookup.c8
-rw-r--r--usr.sbin/crunchgen/crunchgen.c6
-rw-r--r--usr.sbin/zdump/zdump.c6
5 files changed, 26 insertions, 10 deletions
diff --git a/usr.sbin/bind/bin/dig/dig.c b/usr.sbin/bind/bin/dig/dig.c
index 156d1bcdb76..fbe399defee 100644
--- a/usr.sbin/bind/bin/dig/dig.c
+++ b/usr.sbin/bind/bin/dig/dig.c
@@ -1755,8 +1755,10 @@ main(int argc, char **argv) {
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
- if (pledge("stdio rpath dns", NULL) == -1)
+ if (pledge("stdio rpath dns", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
debug("main()");
preparse_args(argc, argv);
@@ -1766,8 +1768,10 @@ main(int argc, char **argv) {
setup_libs();
parse_args(ISC_FALSE, ISC_FALSE, argc, argv);
- if (pledge("stdio dns", NULL) == -1)
+ if (pledge("stdio dns", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
setup_system();
if (domainopt[0] != '\0') {
diff --git a/usr.sbin/bind/bin/dig/host.c b/usr.sbin/bind/bin/dig/host.c
index c272f6cf08c..ff41d34a112 100644
--- a/usr.sbin/bind/bin/dig/host.c
+++ b/usr.sbin/bind/bin/dig/host.c
@@ -839,8 +839,10 @@ main(int argc, char **argv) {
idnoptions = IDN_ASCCHECK;
#endif
- if (pledge("stdio rpath dns inet", NULL) == -1)
+ if (pledge("stdio rpath dns inet", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
debug("main()");
progname = argv[0];
@@ -850,8 +852,10 @@ main(int argc, char **argv) {
setup_libs();
parse_args(ISC_FALSE, argc, argv);
- if (pledge("stdio dns", NULL) == -1)
+ if (pledge("stdio dns", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
setup_system();
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
diff --git a/usr.sbin/bind/bin/dig/nslookup.c b/usr.sbin/bind/bin/dig/nslookup.c
index d9a7085948d..e1d0ceda30e 100644
--- a/usr.sbin/bind/bin/dig/nslookup.c
+++ b/usr.sbin/bind/bin/dig/nslookup.c
@@ -867,14 +867,18 @@ main(int argc, char **argv) {
result = isc_app_start();
check_result(result, "isc_app_start");
- if (pledge("stdio rpath dns", NULL) == -1)
+ if (pledge("stdio rpath dns", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
setup_libs();
progname = argv[0];
- if (pledge("stdio dns", NULL) == -1)
+ if (pledge("stdio dns", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
parse_args(argc, argv);
diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c
index 4213b91594b..938f44a5225 100644
--- a/usr.sbin/crunchgen/crunchgen.c
+++ b/usr.sbin/crunchgen/crunchgen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crunchgen.c,v 1.15 2015/10/13 15:11:48 deraadt Exp $ */
+/* $OpenBSD: crunchgen.c,v 1.16 2015/11/11 02:52:46 deraadt Exp $ */
/*
* Copyright (c) 1994 University of Maryland
@@ -118,8 +118,10 @@ main(int argc, char *argv[])
extern int optind;
extern char *optarg;
- if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1)
+ if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
while ((optc = getopt(argc, argv, "hm:c:e:fqD:EL:O:M")) != -1) {
switch (optc) {
diff --git a/usr.sbin/zdump/zdump.c b/usr.sbin/zdump/zdump.c
index f3f38be2428..ef4064873a6 100644
--- a/usr.sbin/zdump/zdump.c
+++ b/usr.sbin/zdump/zdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zdump.c,v 1.11 2015/10/12 01:40:09 deraadt Exp $ */
+/* $OpenBSD: zdump.c,v 1.12 2015/11/11 02:52:46 deraadt Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2009-05-17 by Arthur David Olson.
@@ -121,8 +121,10 @@ main(int argc, char *argv[])
struct tm tm, newtm, *tmp, *newtmp;
char **fakeenv;
- if (pledge("stdio", NULL) == -1)
+ if (pledge("stdio", NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
while ((c = getopt(argc, argv, "c:v")) == 'c' || c == 'v') {
switch (c) {