]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
cdp: open the inotify stream using the CLOEXEC (close on exec) flag
authorAlain Spineux <alain@baculasystems.com>
Tue, 31 Aug 2021 08:57:24 +0000 (10:57 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:03 +0000 (09:03 +0100)
- this will avoid for any child to corrupt the inotify stream

bacula/src/tools/cdp-client/folderwatcher.cpp

index 72ee4eb2300c6d97a61cb86566fee26ad342991d..2c4c266fe2d6507d680ab0c8621a2deae1831b4a 100644 (file)
@@ -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);