summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-11-13 18:05:38 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-11-13 18:05:38 +0000
commitf4eab46608e0432dfbcb2c4e9620b7820b18ec7f (patch)
treeba0bff53a2408427b0761e9f3c846a0da3546c7e /usr.bin
parent67576297e261ee6a1d69d82c088ce053227d80c7 (diff)
move pledge(2) after setrtable(2), like in nc(1);
OK deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/telnet/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 2e5eb2c7912..e524ce3bc13 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.33 2015/11/13 17:13:59 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.34 2015/11/13 18:05:37 schwarze Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
@@ -80,11 +80,6 @@ main(int argc, char *argv[])
char *user, *alias;
const char *errstr;
- if (pledge("stdio rpath wpath getpw inet tty", NULL) == -1) {
- perror("pledge");
- exit(1);
- }
-
tninit(); /* Clear out things */
TerminalSaveState();
@@ -174,6 +169,11 @@ main(int argc, char *argv[])
exit(1);
}
+ if (pledge("stdio rpath wpath getpw inet tty", NULL) == -1) {
+ perror("pledge");
+ exit(1);
+ }
+
if (autologin == -1)
autologin = (rlogin == _POSIX_VDISABLE) ? 0 : 1;