mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-03 15:55:40 +00:00
now sets tty correctly when piped input
This commit is contained in:
@@ -135,7 +135,9 @@ void log_error(code)
|
|||||||
/*
|
/*
|
||||||
* Get our ttyname or set to "none"
|
* 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, '/')))
|
if (tty && (p = strrchr(tty, '/')))
|
||||||
tty = p + 1;
|
tty = p + 1;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user