From 640f79e13a084dc9dd0b10735f3e900678c50303 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 6 Aug 2010 12:07:21 -0400 Subject: [PATCH] When removing/resetting the timestamp file ignore the tty ticket contents. --- plugins/sudoers/check.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/check.c b/plugins/sudoers/check.c index 8b2940b0e..f30142403 100644 --- a/plugins/sudoers/check.c +++ b/plugins/sudoers/check.c @@ -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) { -- 2.40.0