From 45e3c0dd17d5af8e99c1c83b4fce91a64a1e0857 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 2 Nov 2023 09:10:49 -0600 Subject: [PATCH] timestamp_open: add some debugging --- plugins/sudoers/timestamp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/sudoers/timestamp.c b/plugins/sudoers/timestamp.c index 20bcc2d61..d9eb447e0 100644 --- a/plugins/sudoers/timestamp.c +++ b/plugins/sudoers/timestamp.c @@ -481,6 +481,8 @@ timestamp_open(const struct sudoers_context *ctx) /* Already logged set_perms/restore_perms error. */ goto bad; } + sudo_debug_printf(SUDO_DEBUG_INFO, "%s: opened time stamp file %s", + __func__, fname); /* Remove time stamp file if its mtime predates boot time. */ if (tries == 1 && fstat(fd, &sb) == 0) { @@ -521,6 +523,8 @@ timestamp_open(const struct sudoers_context *ctx) close(dfd); debug_return_ptr(cookie); bad: + sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO, + "%s: unable to open time stamp file %s", __func__, fname); if (dfd != -1) close(dfd); if (fd >= 0)