]> granicus.if.org Git - sudo/commitdiff
Having a timestamp file defined is no longer indicative of tty tickets
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 7 Oct 2010 18:08:16 +0000 (14:08 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 7 Oct 2010 18:08:16 +0000 (14:08 -0400)
being enabled.  Check def_tty_tickets directly.

--HG--
branch : 1.7

check.c

diff --git a/check.c b/check.c
index e73167cc3b67d741577d136d0c8e22494bf6ad84..e40e1238cf6388d64c27b9f15bcdcffd6d7a2a4e 100644 (file)
--- a/check.c
+++ b/check.c
@@ -210,7 +210,7 @@ update_timestamp(timestampdir, timestampfile)
     char *timestampfile;
 {
     /* If using tty timestamps but we have no tty there is nothing to do. */
-    if (timestampfile && !user_ttypath)
+    if (def_tty_tickets && !user_ttypath)
        return;
 
     if (timestamp_uid != 0)
@@ -534,7 +534,7 @@ timestamp_status(timestampdir, timestampfile, user, flags)
     if (timestampfile && status != TS_ERROR) {
        if (status != TS_MISSING)
            status = TS_NOFILE;                 /* dir there, file missing */
-       if (!user_ttypath)
+       if (def_tty_tickets && !user_ttypath)
            goto done;                          /* no tty, always prompt */
        if (lstat(timestampfile, &sb) == 0) {
            if (!S_ISREG(sb.st_mode)) {