diff --git a/plugins/sudoers/audit.c b/plugins/sudoers/audit.c index 67845d6d2..d6e0f2962 100644 --- a/plugins/sudoers/audit.c +++ b/plugins/sudoers/audit.c @@ -335,7 +335,7 @@ sudoers_audit_accept(const char *plugin_name, unsigned int plugin_type, if (audit_success(run_argv) != 0 && !def_ignore_audit_errors) ret = false; - if (!log_allowed() && !def_ignore_logfile_errors) + if (!log_allowed(run_argv, run_envp) && !def_ignore_logfile_errors) ret = false; if (!log_server_accept(command_info, run_argv, run_envp)) { diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 2fcfd6221..6d0f6cc9a 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -463,7 +463,7 @@ log_auth_failure(int status, unsigned int tries) * Log and potentially mail the allowed command. */ bool -log_allowed(void) +log_allowed(char *const argv[], char *const envp[]) { struct eventlog evlog; int oldlocale; @@ -478,7 +478,7 @@ log_allowed(void) /* Log and mail messages should be in the sudoers locale. */ sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale); - sudoers_to_eventlog(&evlog, NewArgv, env_get()); + sudoers_to_eventlog(&evlog, argv, envp); if (mailit) { SET(evl_flags, EVLOG_MAIL); if (!def_log_allowed) diff --git a/plugins/sudoers/logging.h b/plugins/sudoers/logging.h index 17938bd2d..b722cd7b3 100644 --- a/plugins/sudoers/logging.h +++ b/plugins/sudoers/logging.h @@ -56,7 +56,7 @@ bool sudoers_setlocale(int locale_type, int *prev_locale); int sudoers_getlocale(void); int audit_failure(char *const argv[], char const *const fmt, ...) __printflike(2, 3); int vaudit_failure(char *const argv[], char const *const fmt, va_list ap) __printflike(2, 0); -bool log_allowed(void); +bool log_allowed(char *const argv[], char *const envp[]); bool log_exit_status(int exit_status); bool log_auth_failure(int status, unsigned int tries); bool log_denial(int status, bool inform_user);