Skip to content

Commit 7ba8419

Browse files
committed
Guard FAN_FS_ERROR poll slot setup
The new configure switch compiled out FAN_FS_ERROR handling, but the daemon still unconditionally populated the optional third poll slot from fanotify_fs_error_fd(). That helper returned -1 when disabled, so the runtime behavior was harmless, but the main loop still looked as if it always considered the FS_ERROR descriptor path. Wrap the pfd[2] assignment and pfd_count promotion in FAPOLICYD_ENABLE_FANOTIFY_FS_ERROR. When the feature is disabled at configure time, the daemon no longer assigns or polls the optional FAN_FS_ERROR slot at all.
1 parent 93fdff5 commit 7ba8419

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/daemon/fapolicyd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,11 +1322,13 @@ int main(int argc, const char *argv[])
13221322
handle_mounts(pfd[0].fd);
13231323
pfd[1].fd = init_fanotify(&config, m);
13241324
pfd[1].events = POLLIN;
1325+
#ifdef FAPOLICYD_ENABLE_FANOTIFY_FS_ERROR
13251326
pfd[2].fd = fanotify_fs_error_fd();
13261327
if (pfd[2].fd >= 0) {
13271328
pfd[2].events = POLLIN;
13281329
pfd_count = 3;
13291330
}
1331+
#endif
13301332

13311333
msg(LOG_INFO, "Starting to listen for events");
13321334
while (!stop) {

0 commit comments

Comments
 (0)