]> 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:08:01 +0000 (08:08 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Jun 2010 14:08:01 +0000 (08:08 -0600)
--HG--
branch : 1.7

check.c

diff --git a/check.c b/check.c
index 9f799e50eca298f2422150f2dd1ccec88ab14cbf..11119e5ffbf2a7b9878150da7d9be2818df11792 100644 (file)
--- a/check.c
+++ b/check.c
@@ -205,6 +205,10 @@ update_timestamp(timestampdir, timestampfile)
     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) {