aboutsummaryrefslogtreecommitdiff
path: root/utils/shadow/patches/004-fix-su-controoling-term.patch
blob: 4c130c7367b95c413343877e1bc9c737124d2caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- a/src/su.c
+++ b/src/su.c
@@ -1090,8 +1090,12 @@
 
 		if (fd >= 0) {
 			err = ioctl (fd, TIOCNOTTY, (char *) 0);
+			if (-1 == err && ENOTTY == errno) {
+				/* There are no controlling terminal already */
+				err = 0;
+			}
 			(void) close (fd);
-		} else if (ENXIO == errno) {
+		} else if (ENXIO == errno || EACCES == errno) {
 			/* There are no controlling terminal already */
 			err = 0;
 		}