Set user_tty to "unknown" if there is no tty, like sudo 1.7 does

(it is used when logging).  Note that user_ttypath will still be
NULL if there is no tty.
This commit is contained in:
Todd C. Miller
2010-05-21 12:19:55 -04:00
parent 064cffd575
commit 529bfcf674

View File

@@ -1314,6 +1314,8 @@ deserialize_info(char * const settings[], char * const user_info[])
continue;
}
}
if (user_tty == NULL)
user_tty = "unknown"; /* user_ttypath remains NULL */
#undef MATCHES
return flags;