summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-11-17 18:14:58 +0000
committerderaadt <deraadt@openbsd.org>2018-11-17 18:14:58 +0000
commit781a00ff43ebf1dbeaa380c0f875c809ad567dc9 (patch)
tree73a375858c0ffef6800e7a3f908f87277f869011
parentmake the bogon set competely or-longer, rather than having to manage it (diff)
downloadwireguard-openbsd-781a00ff43ebf1dbeaa380c0f875c809ad567dc9.tar.xz
wireguard-openbsd-781a00ff43ebf1dbeaa380c0f875c809ad567dc9.zip
Use a very regular call pattern to pledge, so that we can continue to
grep and compare the use in all programs..
-rw-r--r--bin/ksh/main.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/bin/ksh/main.c b/bin/ksh/main.c
index fd8fbb14bd2..63508d4dc84 100644
--- a/bin/ksh/main.c
+++ b/bin/ksh/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.94 2018/11/16 06:41:58 nicm Exp $ */
+/* $OpenBSD: main.c,v 1.95 2018/11/17 18:14:58 deraadt Exp $ */
/*
* startup, main loop, environments and error handling
@@ -142,20 +142,21 @@ main(int argc, char *argv[])
char **wp;
struct env env;
pid_t ppid;
- int rv;
kshname = argv[0];
if (issetugid()) { /* could later drop privileges */
- rv = pledge("stdio rpath wpath cpath fattr flock getpw proc "
- "exec tty id", NULL);
+ if (pledge("stdio rpath wpath cpath fattr flock getpw proc "
+ "exec tty id", NULL) == -1) {
+ perror("pledge");
+ exit(1);
+ }
} else {
- rv = pledge("stdio rpath wpath cpath fattr flock getpw proc "
- "exec tty", NULL);
- }
- if (rv == -1) {
- perror("pledge");
- exit(1);
+ if (pledge("stdio rpath wpath cpath fattr flock getpw proc "
+ "exec tty", NULL) == -1) {
+ perror("pledge");
+ exit(1);
+ }
}
ainit(&aperm); /* initialize permanent Area */