timestamp_open: add some debugging

This commit is contained in:
Todd C. Miller
2023-11-02 09:10:49 -06:00
parent 3297ffa267
commit 45e3c0dd17

View File

@@ -481,6 +481,8 @@ timestamp_open(const struct sudoers_context *ctx)
/* Already logged set_perms/restore_perms error. */ /* Already logged set_perms/restore_perms error. */
goto bad; 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. */ /* Remove time stamp file if its mtime predates boot time. */
if (tries == 1 && fstat(fd, &sb) == 0) { if (tries == 1 && fstat(fd, &sb) == 0) {
@@ -521,6 +523,8 @@ timestamp_open(const struct sudoers_context *ctx)
close(dfd); close(dfd);
debug_return_ptr(cookie); debug_return_ptr(cookie);
bad: bad:
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
"%s: unable to open time stamp file %s", __func__, fname);
if (dfd != -1) if (dfd != -1)
close(dfd); close(dfd);
if (fd >= 0) if (fd >= 0)