2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Set sudoers locale in log_allowed()

This commit is contained in:
Todd C. Miller
2012-11-09 16:31:23 -05:00
parent 69cb0c3215
commit e28ce01fe0

View File

@@ -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;
}