]> granicus.if.org Git - sudo/commitdiff
When removing/resetting the timestamp file ignore the tty ticket contents.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 6 Aug 2010 13:39:01 +0000 (09:39 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 6 Aug 2010 13:39:01 +0000 (09:39 -0400)
--HG--
branch : 1.7

check.c

diff --git a/check.c b/check.c
index 942da76dd44fcf8aedfa149a5cb6dad437e28075..96af763b1043dbdd2d57ba1a137d7d3cf0535da2 100644 (file)
--- a/check.c
+++ b/check.c
@@ -561,9 +561,12 @@ timestamp_status(timestampdir, timestampfile, user, flags)
                    /*
                     * Check for stored tty info.  If the file is zero-sized
                     * it is an old-style timestamp with no tty info in it.
+                    * If removing, we don't care about the contents.
                     * The actual mtime check is done later.
                     */
-                   if (sb.st_size != 0) {
+                   if (ISSET(flags, TS_REMOVE)) {
+                       status = TS_OLD;
+                   } else if (sb.st_size != 0) {
                        struct tty_info info;
                        int fd = open(timestampfile, O_RDONLY, 0644);
                        if (fd != -1) {