From e28ce01fe0d857235257f44b13b550e8f1787ae1 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 9 Nov 2012 16:31:23 -0500 Subject: [PATCH] Set sudoers locale in log_allowed() --- plugins/sudoers/logging.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 2b61f3869..7dcda03c7 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -387,8 +387,12 @@ void log_allowed(int status) { char *logline; + int oldlocale; debug_decl(log_allowed, SUDO_DEBUG_LOGGING) + /* Log and mail messages should be in the sudoers locale. */ + sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale); + logline = new_logline(NULL, 0); if (should_mail(status)) @@ -403,6 +407,9 @@ log_allowed(int status) do_logfile(logline); efree(logline); + + sudoers_setlocale(oldlocale, NULL); + debug_return; } -- 2.40.0