Steve Grubb d05050
diff -urp audit-1.7.2.orig/audisp/plugins/prelude/audisp-prelude.c audit-1.7.2/audisp/plugins/prelude/audisp-prelude.c
Steve Grubb d05050
--- audit-1.7.2.orig/audisp/plugins/prelude/audisp-prelude.c	2008-04-07 16:57:12.000000000 -0400
Steve Grubb f2add7
+++ audit-1.7.2/audisp/plugins/prelude/audisp-prelude.c	2008-04-18 14:23:06.000000000 -0400
Steve Grubb d05050
@@ -228,7 +228,8 @@ int main(int argc, char *argv[])
Steve Grubb d05050
 		return -1;
Steve Grubb d05050
 	}
Steve Grubb d05050
 
Steve Grubb d05050
-	syslog(LOG_INFO, "audisp-prelude is ready for events");
Steve Grubb d05050
+	if (mode != M_TEST)
Steve Grubb d05050
+		syslog(LOG_INFO, "audisp-prelude is ready for events");
Steve Grubb d05050
 	do {
Steve Grubb d05050
 		/* Load configuration */
Steve Grubb d05050
 		if (hup) {
Steve Grubb d05050
@@ -248,9 +249,10 @@ int main(int argc, char *argv[])
Steve Grubb d05050
 	/* Flush any accumulated events from queue */
Steve Grubb d05050
 	auparse_flush_feed(au);
Steve Grubb d05050
 
Steve Grubb d05050
-	syslog(LOG_INFO, "audisp-prelude is exiting on stop request");
Steve Grubb d05050
 	if (mode == M_TEST)
Steve Grubb d05050
 		puts("audisp-prelude is exiting on stop request");
Steve Grubb d05050
+	else
Steve Grubb d05050
+		syslog(LOG_INFO, "audisp-prelude is exiting on stop request");
Steve Grubb d05050
 
Steve Grubb d05050
 	/* Cleanup subsystems */
Steve Grubb d05050
 	if (client) 
Steve Grubb f2add7
@@ -609,7 +611,7 @@ static int get_login_exe_info(auparse_st
Steve Grubb f2add7
 		base = basename(exe);
Steve Grubb f2add7
 		ret = prelude_string_new(&name_str);
Steve Grubb f2add7
 		PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
-		ret = prelude_string_set_ref(name_str, base);
Steve Grubb f2add7
+		ret = prelude_string_set_dup(name_str, base);
Steve Grubb f2add7
 		PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
 		idmef_process_set_name(process, name_str);
Steve Grubb f2add7
 	}
Steve Grubb f2add7
@@ -708,7 +710,7 @@ static int get_comm_info(auparse_state_t
Steve Grubb f2add7
 			char *base = basename(exe);
Steve Grubb f2add7
 			ret = prelude_string_new(&name_str);
Steve Grubb f2add7
 			PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
-			ret = prelude_string_set_ref(name_str, base);
Steve Grubb f2add7
+			ret = prelude_string_set_dup(name_str, base);
Steve Grubb f2add7
 			idmef_process_set_name(process, name_str);
Steve Grubb f2add7
 		}
Steve Grubb f2add7
 	}
Steve Grubb f2add7
@@ -760,7 +762,7 @@ static int get_file_info(auparse_state_t
Steve Grubb f2add7
 		ret = prelude_string_new(&str);
Steve Grubb f2add7
 		PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
 
Steve Grubb f2add7
-		ret = prelude_string_set_ref(str, path);
Steve Grubb f2add7
+		ret = prelude_string_set_dup(str, path);
Steve Grubb f2add7
 		PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
 		if (path[0] == '/') {
Steve Grubb f2add7
 			char *base;
Steve Grubb f2add7
@@ -772,7 +774,7 @@ static int get_file_info(auparse_state_t
Steve Grubb f2add7
 				base = "/";
Steve Grubb f2add7
 			ret = prelude_string_new(&name_str);
Steve Grubb f2add7
 			PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
-			ret = prelude_string_set_ref(name_str, base);
Steve Grubb f2add7
+			ret = prelude_string_set_dup(name_str, base);
Steve Grubb f2add7
 			PRELUDE_FAIL_CHECK;
Steve Grubb f2add7
 			idmef_file_set_name(file, name_str);
Steve Grubb f2add7
 		} else
Steve Grubb f2add7
@@ -1811,7 +1813,7 @@ static void handle_event(auparse_state_t
Steve Grubb f2add7
 		rc = 0;
Steve Grubb f2add7
 		switch (type) {
Steve Grubb f2add7
 			case AUDIT_AVC:
Steve Grubb f2add7
-			case AUDIT_USER_AVC:
Steve Grubb f2add7
+//			case AUDIT_USER_AVC:
Steve Grubb f2add7
 				if (config.avcs == E_NO)
Steve Grubb f2add7
 					break;
Steve Grubb f2add7
 				if (config.avcs_act != A_IDMEF)
Steve Grubb f2add7
diff -urp audit-1.7.2.orig/auparse/auparse.c audit-1.7.2/auparse/auparse.c
Steve Grubb f2add7
--- audit-1.7.2.orig/auparse/auparse.c	2008-04-08 12:37:09.000000000 -0400
Steve Grubb f2add7
+++ audit-1.7.2/auparse/auparse.c	2008-04-18 14:10:36.000000000 -0400
Steve Grubb f2add7
@@ -1130,6 +1130,7 @@ int auparse_first_record(auparse_state_t
Steve Grubb f2add7
 			return rc;
Steve Grubb f2add7
 	}
Steve Grubb f2add7
 	aup_list_first(&au->le);
Steve Grubb f2add7
+	aup_list_first_field(&au->le);
Steve Grubb f2add7
 	
Steve Grubb f2add7
 	return 1;
Steve Grubb f2add7
 }
Steve Grubb f2add7
@@ -1236,7 +1237,22 @@ const char *auparse_find_field(auparse_s
Steve Grubb f2add7
 {
Steve Grubb f2add7
 	free(au->find_field);
Steve Grubb f2add7
 	au->find_field = strdup(name);
Steve Grubb f2add7
-	return auparse_find_field_next(au);
Steve Grubb f2add7
+
Steve Grubb f2add7
+	if (au->le.e.sec) {
Steve Grubb f2add7
+		const char *cur_name;
Steve Grubb f2add7
+		rnode *r;
Steve Grubb f2add7
+
Steve Grubb f2add7
+		// look at current record before moving
Steve Grubb f2add7
+		r = aup_list_get_cur(&au->le);
Steve Grubb f2add7
+		if (r == NULL)
Steve Grubb f2add7
+			return NULL;
Steve Grubb f2add7
+		cur_name = nvlist_get_cur_name(&r->nv);
Steve Grubb f2add7
+		if (cur_name && strcmp(cur_name, name) == 0)
Steve Grubb f2add7
+			return nvlist_get_cur_val(&r->nv);
Steve Grubb f2add7
+
Steve Grubb f2add7
+		return auparse_find_field_next(au);
Steve Grubb f2add7
+	}
Steve Grubb f2add7
+	return NULL;
Steve Grubb f2add7
 }
Steve Grubb f2add7
 
Steve Grubb f2add7
 /* Increment 1 location and then scan for next field */
Steve Grubb f2add7
@@ -1258,6 +1274,8 @@ const char *auparse_find_field_next(aupa
Steve Grubb f2add7
 			if (nvlist_find_name(&r->nv, au->find_field))
Steve Grubb f2add7
 				return nvlist_get_cur_val(&r->nv);
Steve Grubb f2add7
 			r = aup_list_next(&au->le);
Steve Grubb f2add7
+			if (r)
Steve Grubb f2add7
+				aup_list_first_field(&au->le);
Steve Grubb f2add7
 		}
Steve Grubb f2add7
 	}
Steve Grubb f2add7
 	return NULL;