From 34593ec63f7cab4ae1f4e205432cd065d867a5c5 Mon Sep 17 00:00:00 2001 From: Alain Spineux Date: Tue, 31 Aug 2021 10:57:24 +0200 Subject: [PATCH] cdp: open the inotify stream using the CLOEXEC (close on exec) flag - this will avoid for any child to corrupt the inotify stream --- bacula/src/tools/cdp-client/folderwatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bacula/src/tools/cdp-client/folderwatcher.cpp b/bacula/src/tools/cdp-client/folderwatcher.cpp index 72ee4eb23..2c4c266fe 100644 --- a/bacula/src/tools/cdp-client/folderwatcher.cpp +++ b/bacula/src/tools/cdp-client/folderwatcher.cpp @@ -55,7 +55,7 @@ FolderWatcher::FolderWatcher(FileChangeHandler *handler) POOLMEM *FolderWatcher::watch(const char *folder) { - _fd = inotify_init(); + _fd = inotify_init1(IN_CLOEXEC); if (_fd == -1) { POOLMEM *err_msg = get_pool_memory(PM_EMSG); -- 2.47.3