2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

now sets tty correctly when piped input

This commit is contained in:
Todd C. Miller
1995-08-14 03:39:05 +00:00
parent fee6ecbf07
commit a7260a073a

View File

@@ -135,7 +135,9 @@ void log_error(code)
/*
* Get our ttyname or set to "none"
*/
tty = (char *) ttyname(0);
if ((tty = (char *) ttyname(0)) == NULL)
tty = (char *) ttyname(1);
if (tty && (p = strrchr(tty, '/')))
tty = p + 1;
else