From: Todd C. Miller Date: Fri, 18 Jun 2010 14:00:16 +0000 (-0600) Subject: Do not update tty ticket if there is no tty. X-Git-Tag: SUDO_1_8_0~444 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5c5a9bf6af7e1b5292a43b52b3916c5d0b5e5e0;p=sudo Do not update tty ticket if there is no tty. --- diff --git a/plugins/sudoers/check.c b/plugins/sudoers/check.c index 8df4a9f40..008edc450 100644 --- a/plugins/sudoers/check.c +++ b/plugins/sudoers/check.c @@ -202,6 +202,10 @@ lecture(int status) static void update_timestamp(char *timestampdir, char *timestampfile) { + /* If using tty timestamps but we have no tty there is nothing to do. */ + if (timestampfile && !user_ttypath) + return; + if (timestamp_uid != 0) set_perms(PERM_TIMESTAMP); if (timestampfile) {