diff options
author | 2017-01-23 04:57:13 +0000 | |
---|---|---|
committer | 2017-01-23 04:57:13 +0000 | |
commit | 2acff6691b5b3db0fa0c10fdb993835abf4d7da7 (patch) | |
tree | 55edc0919ca22b7b76b10d2c8fa8547828304ad0 | |
parent | move the callbacks from ssl_st to internal (diff) | |
download | wireguard-openbsd-2acff6691b5b3db0fa0c10fdb993835abf4d7da7.tar.xz wireguard-openbsd-2acff6691b5b3db0fa0c10fdb993835abf4d7da7.zip |
pledge a tiny bit later. This results in the specified tty being
opened before the first pledge call.
testing by tb and benno and others
-rw-r--r-- | libexec/getty/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 05b1189c4a0..95ec554a163 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.42 2016/03/16 15:41:10 krw Exp $ */ +/* $OpenBSD: main.c,v 1.43 2017/01/23 04:57:13 deraadt Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -170,11 +170,6 @@ main(int argc, char *argv[]) ioctl(0, FIOASYNC, &off); /* turn off async mode */ - if (pledge("stdio rpath wpath fattr proc exec tty", NULL) == -1) { - syslog(LOG_ERR, "pledge: %m"); - exit(1); - } - /* * The following is a work around for vhangup interactions * which cause great problems getting window systems started. @@ -183,6 +178,11 @@ main(int argc, char *argv[]) * J. Gettys - MIT Project Athena. */ if (argc <= 2 || strcmp(argv[2], "-") == 0) { + if (pledge("stdio rpath proc exec tty", NULL) == -1) { + syslog(LOG_ERR, "pledge: %m"); + exit(1); + } + if ((tname = ttyname(0)) == NULL) { syslog(LOG_ERR, "stdin: %m"); exit(1); |