]> granicus.if.org Git - sudo/commitdiff
Do not update tty ticket if there is no tty.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Jun 2010 14:00:16 +0000 (08:00 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Jun 2010 14:00:16 +0000 (08:00 -0600)
plugins/sudoers/check.c

index 8df4a9f405a29f1e87858f75c999c0ab98144b55..008edc450318a73e39316d91d9ccf662c4679c93 100644 (file)
@@ -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) {