mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
fixed a typo that caused commands with no tty on fd 0 but a tty
on fd 1 to erroneously have "none" as their tty
This commit is contained in:
parent
63cfcdca9d
commit
cc1ab5b5b6
2
sudo.c
2
sudo.c
@ -371,7 +371,7 @@ static void load_globals(sudo_mode)
|
||||
/*
|
||||
* Need to get tty early since it's used for logging
|
||||
*/
|
||||
if ((tty = (char *) ttyname(0)) || (tty = (char *) ttyname(0))) {
|
||||
if ((tty = (char *) ttyname(0)) || (tty = (char *) ttyname(1))) {
|
||||
if (strncmp(tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
|
||||
tty += sizeof(_PATH_DEV) - 1;
|
||||
if ((tty = strdup(tty)) == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user