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

Add SLOG_AUDIT flag for log_warningx() to also audit the message.

This lets us combine audit_failure() and log_warningx() calls with
the same message.
This commit is contained in:
Todd C. Miller
2020-09-23 08:18:55 -06:00
parent 6ee731caff
commit f1d19f1d6e
4 changed files with 36 additions and 29 deletions

View File

@@ -44,6 +44,7 @@
#define SLOG_SEND_MAIL 0x08 /* log via mail */
#define SLOG_NO_STDERR 0x10 /* do not log via stderr */
#define SLOG_NO_LOG 0x20 /* do not log via file or syslog */
#define SLOG_AUDIT 0x40 /* send message to audit as well */
/*
* Maximum number of characters to log per entry. The syslogger
@@ -74,6 +75,7 @@ bool sudoers_warn_setlocale(bool restore, int *cookie);
bool sudoers_setlocale(int newlocale, int *prevlocale);
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(int status);
bool log_auth_failure(int status, unsigned int tries);
bool log_denial(int status, bool inform_user);