Blob Blame History Raw
From 89ff6436b55cd81c54dcb076490b0c4de98d508d Mon Sep 17 00:00:00 2001
From: Jiri Vymazal <jvymazal@redhat.com>
Date: Tue, 9 Jun 2020 12:09:59 +0200
Subject: [PATCH] Fixing imfile segfaulting on selinux denial

If imfile is denied access to file watched trough symlink there is
unchecked condition resulting in access to not initialized memory.
---
 plugins/imfile/imfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index f360bd290b..21d6546552 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -732,7 +732,7 @@ act_obj_add(fs_edge_t *const edge, const char *const name, const int is_file,
 		} else { /* reporting only in debug for dirs as higher lvl paths are likely blocked by selinux */
 			DBGPRINTF("imfile: error accessing directory '%s'", name);
 		}
-		FINALIZE;
+		ABORT_FINALIZE(RS_RET_NO_FILE_ACCESS);
 	}
 	DBGPRINTF("add new active object '%s' in '%s'\n", name, edge->path);
 	CHKmalloc(act = calloc(sizeof(act_obj_t), 1));