packages/utils/shadow/patches/004-fix-su-controoling-term.patch
Rosen Penev 2192c572a3 shadow: Update to 4.6
Switched dead URLs to new upstream.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-08-15 18:31:34 -07:00

16 lines
440 B
Diff

--- a/src/su.c
+++ b/src/su.c
@@ -1127,8 +1127,12 @@ int main (int argc, char **argv)
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;
}