summaryrefslogtreecommitdiffstats
path: root/libexec/getty
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-11-17 01:40:51 +0000
committerderaadt <deraadt@openbsd.org>2018-11-17 01:40:51 +0000
commit3e05b07b2b5b5560d29d1c1fd0ba3420eb8e8f01 (patch)
tree10b42e2914045f41ea1a5419a8a7831fc05816b9 /libexec/getty
parentrevert previous (diff)
downloadwireguard-openbsd-3e05b07b2b5b5560d29d1c1fd0ba3420eb8e8f01.tar.xz
wireguard-openbsd-3e05b07b2b5b5560d29d1c1fd0ba3420eb8e8f01.zip
need to closefrom(0) before execve(), otherwise tty isn't properly
'hung up'; some testing by Theodore Wynnychenko
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index a57128131c3..23af8cf0cda 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.50 2018/11/15 03:04:10 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.51 2018/11/17 01:40:51 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -261,6 +261,7 @@ main(int argc, char *argv[])
gettable(tname, tabent);
if (strcmp(LO, saveLO) != 0) {
/* re-exec to apply new unveil */
+ closefrom(0);
execv(_PATH_GETTY, argv);
exit(0);
}