[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] getty: prevent getty from changing tty lines protections and ownership
From:       bboubaker <boubaker.bassem.1991 () gmail ! com>
Date:       2022-11-21 13:50:42
Message-ID: 20221121135042.3336052-1-bboubaker () sierrawireless ! com
[Download RAW message or body]

There are dedicated linux sub-systems such as  udev/mdev to handle tty lines ownership and permissions
getty should be only capable of using it and not do an override.

Signed-off-by: bboubaker <bboubaker@sierrawireless.com>
---
 loginutils/getty.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/loginutils/getty.c b/loginutils/getty.c
index cd6378d80..af580dd61 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -219,10 +219,6 @@ static void open_tty(void)
 		debug("open(2)\n");
 		close(0);
 		xopen(G.tty_name, O_RDWR | O_NONBLOCK); /* uses fd 0 */
-
-		/* Set proper protections and ownership */
-		fchown(0, 0, 0);        /* 0:0 */
-		fchmod(0, 0620);        /* crw--w---- */
 	} else {
 		char *n;
 		/*
-- 
2.25.1

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic