Remember to reset ownership and permissions on the tty device
This commit is contained in:
parent
3e0d247d94
commit
ac57c4ab7f
5
getty.c
5
getty.c
@ -76,6 +76,11 @@ main(int argc, char *argv[])
|
|||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sigaction(SIGHUP, &sa, NULL);
|
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)
|
if (argc > 2)
|
||||||
return execvp(argv[2], argv + 2);
|
return execvp(argv[2], argv + 2);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user