Blob Blame History Raw
diff -urp audit-1.6.9/audisp/audispd.c audit-1.6.10/audisp/audispd.c
--- audit-1.6.9/audisp/audispd.c	2008-03-06 12:50:06.000000000 -0500
+++ audit-1.6.10/audisp/audispd.c	2008-03-13 22:11:53.000000000 -0400
@@ -708,6 +711,13 @@ static void process_inbound_event(int fd
 		rc = readv(fd, &vec, 1);
 	} while (rc < 0 && errno == EINTR);
 
+	if (rc <= 0) {
+		if (rc == 0)
+			stop = 1; // End of File
+		free(e);
+		return;
+	}
+
 	if (rc > 0) {
 		/* Sanity check */
 		if (e->hdr.ver != AUDISP_PROTOCOL_VER ||
@@ -728,6 +738,11 @@ static void process_inbound_event(int fd
 
 		if (rc > 0)
 			enqueue(e, &daemon_config);
+		else {
+			if (rc == 0)
+				stop = 1; // End of File
+			free(e);
+		}
 	}
 }
 
diff -urp audit-1.6.8/audisp/audispd-builtins.c audit-1.6.9/audisp/audispd-builtins.c
--- audit-1.6.8/audisp/audispd-builtins.c	2008-02-07 13:37:16.000000000 -0500
+++ audit-1.6.9/audisp/audispd-builtins.c	2008-02-24 11:48:46.000000000 -0500
@@ -226,6 +226,11 @@ void send_af_unix_binary(event_t *e)
 		do {
 			rc = writev(conn, vec, 2);
 		} while (rc < 0 && errno == EINTR);
+		if (rc < 0 && errno == EPIPE) {
+			close(conn);
+			conn = -1;
+			add_event(sock, af_unix_accept);
+		}
 	} 
 }
 
diff -urp audit-1.6.8/audisp/queue.c audit-1.6.9/audisp/queue.c
--- audit-1.6.8/audisp/queue.c	2007-12-28 16:32:45.000000000 -0500
+++ audit-1.6.9/audisp/queue.c	2008-03-02 08:51:05.000000000 -0500
@@ -117,13 +117,16 @@ void enqueue(event_t *e, struct daemon_c
 {
 	unsigned int n, retry_cnt = 0;
 
-	if (processing_suspended)
+	if (processing_suspended) {
+		free(e);
 		return;
+	}
 
 retry:
 	// We allow 3 retries and then its over
 	if (retry_cnt > 3) {
 		do_overflow_action(config);
+		free(e);
 		return;
 	}
 	pthread_mutex_lock(&queue_lock);