public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* [Patch] Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized
@ 2009-02-18  2:48 Chu Li
  2009-02-19 21:57 ` Steve Grubb
  0 siblings, 1 reply; 2+ messages in thread
From: Chu Li @ 2009-02-18  2:48 UTC (permalink / raw)
  To: 'Steve Grubb'; +Cc: linux-audit

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?

Signed-off-by: Chu Li<chul@cn.fujitsu.com>
---
--- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized
  2009-02-18  2:48 [Patch] Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized Chu Li
@ 2009-02-19 21:57 ` Steve Grubb
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2009-02-19 21:57 UTC (permalink / raw)
  To: Chu Li; +Cc: linux-audit

On Tuesday 17 February 2009 09:48:59 pm Chu Li wrote:
>   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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-19 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18  2:48 [Patch] Fix the bug of "exec /path-to-script" in audisp-remote.conf cann't be recognized Chu Li
2009-02-19 21:57 ` Steve Grubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox