From: Alain Spineux Date: Tue, 31 Aug 2021 08:57:24 +0000 (+0200) Subject: cdp: open the inotify stream using the CLOEXEC (close on exec) flag X-Git-Tag: Release-11.3.2~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34593ec63f7cab4ae1f4e205432cd065d867a5c5;p=thirdparty%2Fbacula.git cdp: open the inotify stream using the CLOEXEC (close on exec) flag - this will avoid for any child to corrupt the inotify stream --- 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);