]> granicus.if.org Git - sudo/commitdiff
Use saved errno in vlog_warning() before calling sudo_vwarn_nodebug().
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 21 Mar 2015 21:41:59 +0000 (15:41 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 21 Mar 2015 21:41:59 +0000 (15:41 -0600)
Fixes the error message printed if set_perms() fails.

plugins/sudoers/logging.c

index 9b173f7d9925e15549abef1c8b9810e79396a467..5338749c7f6c8fbe4756aa26f1069b83f6479dc7 100644 (file)
@@ -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