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

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