From ac57c4ab7f0e2d64b503ec9f1863414c4eebeff7 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 11 Feb 2014 13:08:10 +0000 Subject: [PATCH] Remember to reset ownership and permissions on the tty device --- getty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/getty.c b/getty.c index 75b20b6..6d6c747 100644 --- a/getty.c +++ b/getty.c @@ -76,6 +76,11 @@ main(int argc, char *argv[]) sigemptyset(&sa.sa_mask); sigaction(SIGHUP, &sa, NULL); + if (fchown(fd, 0, 0) < 0) + eprintf("fchown %s:", tty); + if (fchmod(fd, 0600) < 0) + eprintf("chmod %s:", tty); + if (argc > 2) return execvp(argv[2], argv + 2);