Blame SOURCES/fapolicyd-fanotify-read-error.patch

25361f
From d12dde7f3fdeb82a9fb064e26d260f40fb2036c0 Mon Sep 17 00:00:00 2001
25361f
From: Steve Grubb <sgrubb@redhat.com>
25361f
Date: Mon, 22 Mar 2021 10:38:31 -0400
25361f
Subject: [PATCH] Do not exit on fanotify_event read failure
25361f
25361f
---
25361f
 ChangeLog           |  1 +
25361f
 src/daemon/notify.c | 11 ++++++++---
25361f
 2 files changed, 9 insertions(+), 3 deletions(-)
25361f
25361f
diff --git a/src/daemon/notify.c b/src/daemon/notify.c
25361f
index 3e42b92..a83db39 100644
25361f
--- a/src/daemon/notify.c
25361f
+++ b/src/daemon/notify.c
25361f
@@ -337,8 +337,13 @@ void handle_events(void)
25361f
 			len = read(fd, (void *) buf, sizeof(buf));
25361f
 		} while (len == -1 && errno == EINTR && stop == 0);
25361f
 		if (len == -1 && errno != EAGAIN) {
25361f
-			msg(LOG_ERR,"Error reading (%s)", strerror(errno));
25361f
-			exit(1);
25361f
+			// If we get this, we have no access to the file. We
25361f
+			// cannot formulate a reply either to deny it because
25361f
+			// we have nothing to work with.
25361f
+			msg(LOG_ERR,
25361f
+			    "Error receiving fanotify_event (%s)",
25361f
+			    strerror(errno));
25361f
+			return;
25361f
 		}
25361f
 		if (stop)
25361f
 			return;