Skip to contentSkip to conversation

Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized

PATCH In review Chu Li 2 participants 2 messages Feb 18, 2009 – Feb 19, 2009

lore
Share & tools
lore

Chu Li

author
#0 lore raw

PATCH 1/1 Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized

Hi Steve,

I set "exec /path-to-script" in /etc/audisp/audisp-remote.conf for
"network_failure_action". the syslog said that it's an invalid option.

It seems a bug in audisp-remote.conf.

Here is my patch for the latest codes. What's your opinion about such
modification?

---
--- audisp/plugins/remote/remote-config.orig.c 2009-02-16 22:19:36.000000000
+0800
+++ audisp/plugins/remote/remote-config.c 2009-02-16 22:54:25.000000000 +0800
@@ -118,13 +118,13 @@ static const struct kw_pair keywords[] =

   {"krb5_principal",         krb5_principal_parser,             0 },
   {"krb5_client_name",       krb5_client_name_parser,           0 },
   {"krb5_key_file",          krb5_key_file_parser,              0 },
-  {"network_failure_action", network_failure_action_parser,	0 },
-  {"disk_low_action",        disk_low_action_parser,		0 },
-  {"disk_full_action",       disk_full_action_parser,		0 },
-  {"disk_error_action",      disk_error_action_parser,		0 },
-  {"remote_ending_action",   remote_ending_action_parser,	0 },
-  {"generic_error_action",   generic_error_action_parser,	0 },
-  {"generic_warning_action", generic_warning_action_parser,	0 },
+  {"network_failure_action", network_failure_action_parser,	1 },
+  {"disk_low_action",        disk_low_action_parser,		1 },
+  {"disk_full_action",       disk_full_action_parser,		1 },
+  {"disk_error_action",      disk_error_action_parser,		1 },
+  {"remote_ending_action",   remote_ending_action_parser,	1 },
+  {"generic_error_action",   generic_error_action_parser,	1 },
+  {"generic_warning_action", generic_warning_action_parser,	1 },

{ NULL, NULL, 0 }
};

@@ -541,17 +541,13 @@ static int action_parser(struct nv_pair
int i;
for (i=0; fail_action_words[i].name != NULL; i++) {
if (strcasecmp(nv->value, fail_action_words[i].name) == 0) {
- *actp = fail_action_words[i].option;
- return 0;
- } else if (i == FA_EXEC) {
- if (strncasecmp(fail_action_words[i].name,
- nv->value, 4) == 0) {
+ if (i == FA_EXEC) {
if (check_exe_name(nv->option, line))
return 1;
*exep = strdup(nv->option);
- *actp = FA_EXEC;
- return 0;
}
+ *actp = fail_action_words[i].option;
+ return 0;
}
}
syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line);

Regards
Chu Li

#1 lore raw
Quoted 4 lines · Chu Li

  I set "exec /path-to-script" in /etc/audisp/audisp-remote.conf for "network_failure_action". the syslog said that it's an invalid option.

  It seems a bug in audisp-remote.conf.

Yes, it looks like it. I will apply this patch with maybe 1 or 2 changes in a couple days. It will be in the next release.

Thanks for pointing this out.

-Steve