2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 22:35:10 +00:00

audit_failure() now calls gettext itself using the sudoers locale.

This commit is contained in:
Todd C. Miller
2012-11-08 15:37:43 -05:00
parent 3f82a3407e
commit f454a852cb
4 changed files with 16 additions and 10 deletions

View File

@@ -65,12 +65,16 @@ void
audit_failure(char *exec_args[], char const *const fmt, ...)
{
va_list ap;
int oldlocale;
debug_decl(audit_success, SUDO_DEBUG_AUDIT)
/* Audit error messages should be in the sudoers locale. */
sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale);
if (exec_args != NULL) {
va_start(ap, fmt);
#ifdef HAVE_BSM_AUDIT
bsm_audit_failure(exec_args, fmt, ap);
bsm_audit_failure(exec_args, _(fmt), ap);
#endif
#ifdef HAVE_LINUX_AUDIT
linux_audit_command(exec_args, 0);
@@ -78,5 +82,7 @@ audit_failure(char *exec_args[], char const *const fmt, ...)
va_end(ap);
}
sudoers_setlocale(oldlocale, NULL);
debug_return;
}