From f4eab46608e0432dfbcb2c4e9620b7820b18ec7f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 13 Nov 2015 18:05:38 +0000 Subject: move pledge(2) after setrtable(2), like in nc(1); OK deraadt@ --- usr.bin/telnet/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.bin/telnet/main.c') 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; -- cgit v1.2.3