From 3b309844067ad8cca71a811cbdd9c4db3eacc02e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 21 Mar 2015 15:41:59 -0600 Subject: [PATCH] Use saved errno in vlog_warning() before calling sudo_vwarn_nodebug(). Fixes the error message printed if set_perms() fails. --- plugins/sudoers/logging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 9b173f7d9..5338749c7 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -501,6 +501,7 @@ vlog_warning(int flags, const char *fmt, va_list ap) sudo_warnx_nodebug(ngettext("%u incorrect password attempt", "%u incorrect password attempts", tries), tries); } else { + errno = serrno; if (ISSET(flags, SLOG_USE_ERRNO)) sudo_vwarn_nodebug(_(fmt), ap2); else -- 2.40.0