[hackers] [ubase] Remember to reset ownership and permissions on the tty device || sin

From: <git_AT_suckless.org>
Date: Fri, 14 Feb 2014 15:12:14 +0100

commit ac57c4ab7f0e2d64b503ec9f1863414c4eebeff7
Author: sin <sin_AT_2f30.org>
Date: Tue Feb 11 13:08:10 2014 +0000

    Remember to reset ownership and permissions on the tty device

diff --git a/getty.c b/getty.c
index 75b20b6..6d6c747 100644
--- a/getty.c
+++ b/getty.c
_AT_@ -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);
 
Received on Fri Feb 14 2014 - 15:12:14 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 14 2014 - 15:24:15 CET