From 310ccccccbb8e7410ea9f8e48a72c9f56e19e48b Mon Sep 17 00:00:00 2001 From: AZero13 Date: Wed, 17 Dec 2025 18:24:28 -0500 Subject: [PATCH] Debug uses the wrong fd It should print it out before it is updated. --- src/preserve_fds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preserve_fds.c b/src/preserve_fds.c index a77d22fc97..d9a55e66c0 100644 --- a/src/preserve_fds.c +++ b/src/preserve_fds.c @@ -100,8 +100,8 @@ closefrom_except(int startfd, struct preserved_fd_list *pfds) /* NOTE: still need to adjust lastfd below with unchanged lowfd. */ } else if (fd < pfd->highfd) { sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO, - "dup %d -> %d", pfd->highfd, pfd->lowfd); - sudo_debug_update_fd(pfd->highfd, pfd->lowfd); + "dup %d -> %d", pfd->highfd, fd); + sudo_debug_update_fd(pfd->highfd, fd); pfd->lowfd = fd; fd = pfd->highfd; }