diff options
| author | Dan McDonald <danmcd@mnx.io> | 2022-10-10 09:10:46 -0400 |
|---|---|---|
| committer | Dan McDonald <danmcd@mnx.io> | 2022-10-10 09:10:46 -0400 |
| commit | 8733bb6571c33535090fb28bcbe9aa273867168a (patch) | |
| tree | d6a55ba8e3b32ff80c64c797b7a1858a23813f5c /usr/src/cmd | |
| parent | 1facf1a43ecaaa0225b7c9d134732d342b607d8d (diff) | |
| parent | d687f445dcb8e0cd6caf81ea59a259f83ac93e2d (diff) | |
| download | illumos-joyent-8733bb6571c33535090fb28bcbe9aa273867168a.tar.gz | |
[illumos-gate merge]
commit d687f445dcb8e0cd6caf81ea59a259f83ac93e2d
15016 find_elf should cope with O_DIRECTORY absence
commit eca0273a3d9494e12a4d82943f1b2d701cde4489
15057 i86pc: redefinition of typedef 'vmm_data_req_t' is a C11 feature
commit bdf9be201fbb95afc4f1d45b03d66d6f0f96c25f
15052 libc: unused label
commit 430fb0518974971393f591123b410c866df1855a
5913 audit_syslog is noisy when it discards messages
commit cd918266dec8ae2553f7a0efd53c52aa90d99a39
2271 CIFS clients fail to authenticate when idmap is using IDMU
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/auditd/doorway.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/usr/src/cmd/auditd/doorway.c b/usr/src/cmd/auditd/doorway.c index c3fe37afe6..59509c2593 100644 --- a/usr/src/cmd/auditd/doorway.c +++ b/usr/src/cmd/auditd/doorway.c @@ -23,6 +23,10 @@ */ /* + * Copyright 2022 Tintri by DDN, Inc. All rights reserved. + */ + +/* * Threads: * * auditd is thread 0 and does signal handling @@ -151,12 +155,12 @@ warn_or_fatal(int fatal, char *parting_shot) static void report_error(int rc, char *error_text, char *plugin_path) { - int warn = 0; char rcbuf[100]; /* short error name string */ char message[FATAL_MESSAGE_LEN]; int bad_count = 0; char *name; char empty[] = ".."; + boolean_t warn = B_FALSE, discard = B_FALSE; static int no_plug = 0; static int no_load = 0; @@ -174,17 +178,17 @@ report_error(int rc, char *error_text, char *plugin_path) switch (rc) { case INTERNAL_LOAD_ERROR: - warn = 1; + warn = B_TRUE; bad_count = ++no_load; (void) strcpy(rcbuf, "load_error"); break; case INTERNAL_SYS_ERROR: - warn = 1; + warn = B_TRUE; bad_count = ++no_thread; (void) strcpy(rcbuf, "sys_error"); break; case INTERNAL_CONFIG_ERROR: - warn = 1; + warn = B_TRUE; bad_count = ++no_plug; (void) strcpy(rcbuf, "config_error"); name = strdup("--"); @@ -192,17 +196,17 @@ report_error(int rc, char *error_text, char *plugin_path) case AUDITD_SUCCESS: break; case AUDITD_NO_MEMORY: /* no_memory */ - warn = 1; + warn = B_TRUE; bad_count = ++no_memory; (void) strcpy(rcbuf, "no_memory"); break; case AUDITD_INVALID: /* invalid */ - warn = 1; + warn = B_TRUE; bad_count = ++invalid; (void) strcpy(rcbuf, "invalid"); break; case AUDITD_RETRY: - warn = 1; + warn = B_TRUE; bad_count = ++retry; (void) strcpy(rcbuf, "retry"); break; @@ -210,10 +214,15 @@ report_error(int rc, char *error_text, char *plugin_path) (void) strcpy(rcbuf, "comm_fail"); break; case AUDITD_FATAL: /* failure */ - warn = 1; + warn = B_TRUE; bad_count = ++fail; (void) strcpy(rcbuf, "failure"); break; + case AUDITD_DISCARD: /* discarded - shouldn't get here */ + /* Don't report this one; it's a non-error. */ + discard = B_TRUE; + (void) strcpy(rcbuf, "discarded"); + break; default: (void) strcpy(rcbuf, "error"); break; @@ -222,7 +231,7 @@ report_error(int rc, char *error_text, char *plugin_path) bad_count, name, rcbuf, error_text)); if (warn) __audit_dowarn2("plugin", name, rcbuf, error_text, bad_count); - else { + else if (!discard) { (void) snprintf(message, FATAL_MESSAGE_LEN, gettext("audit plugin %s reported error = \"%s\": %s\n"), name, rcbuf, error_text); |
