--- embedaddon/sudo/plugins/sudoers/audit.c 2012/05/29 12:26:49 1.1.1.2 +++ embedaddon/sudo/plugins/sudoers/audit.c 2014/06/15 16:22:17 1.1.1.5.2.1 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 Todd C. Miller + * Copyright (c) 2009-2012 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,14 +26,23 @@ # include # endif #endif /* STDC_HEADERS */ +#ifdef HAVE_STDBOOL_H +# include +#else +# include "compat/stdbool.h" +#endif /* HAVE_STDBOOL_H */ #include +#define DEFAULT_TEXT_DOMAIN "sudoers" +#include "gettext.h" /* must be included before missing.h */ + #include "missing.h" #include "logging.h" #include "sudo_debug.h" #ifdef HAVE_BSM_AUDIT # include "bsm_audit.h" +# include "gettext.h" #endif #ifdef HAVE_LINUX_AUDIT # include "linux_audit.h" @@ -60,18 +69,24 @@ 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); #endif va_end(ap); } + + sudoers_setlocale(oldlocale, NULL); debug_return; }