summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2018-11-17 01:40:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2018-11-17 01:40:52 +0000
commit7d7d758497ccc1f0b7660f518e92d93334a6907d (patch)
tree011b4692671fae5d554653a859ee7d0456471508
parent7be8be175fdc183a5b478c77c54d764afac94e32 (diff)
need to closefrom(0) before execve(), otherwise tty isn't properly
'hung up'; some testing by Theodore Wynnychenko
-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);
}