* src/su.c: non PAM enabled versions: do not fail if su is called

without a controlling terminal. Ignore ENXIO errors when opening
	/dev/tty.
This commit is contained in:
nekral-guest
2012-05-20 16:15:14 +00:00
parent 8690c74d6a
commit f100b5ea7e
3 changed files with 18 additions and 0 deletions

View File

@@ -1092,6 +1092,9 @@ int main (int argc, char **argv)
if (fd >= 0) {
err = ioctl (fd, TIOCNOTTY, (char *) 0);
(void) close (fd);
} else if (ENXIO == errno) {
/* There are no controlling terminal already */
err = 0;
}
#endif /* USE_PAM */