]> 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 16:07:21 +0000 (12:07 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 6 Aug 2010 16:07:21 +0000 (12:07 -0400)
plugins/sudoers/check.c

index 8b2940b0ede74e94e32035b2c9b2fd8f67057086..f301424037639533733cd9e917076e83c4c35add 100644 (file)
@@ -550,9 +550,12 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int 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) {