From 529bfcf67467dc12b5f5decfe3d46b236cabbbc5 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 21 May 2010 12:19:55 -0400 Subject: [PATCH] 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. --- plugins/sudoers/sudoers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 6c4b27f48..f9a9bb466 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -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;