]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #9292 about file descriptor leak with the HonorNoDumpFlag fileset option
authorEric Bollengier <eric@baculasystems.com>
Mon, 4 Jul 2022 08:13:32 +0000 (10:13 +0200)
committerEric Bollengier <eric@baculasystems.com>
Mon, 4 Jul 2022 08:13:32 +0000 (10:13 +0200)
bacula/src/findlib/find_one.c

index 4acfd4121af1917b31785a902aab0b02107e41f7..9a4b771f00a01dfddcfe6ac4a39cb6895195f414 100644 (file)
@@ -231,7 +231,7 @@ static bool no_dump(JCR *jcr, FF_PKT *ff_pkt)
    int attr;
    int fd = -1;
    if (ff_pkt->flags & FO_HONOR_NODUMP) {
-      int fd = open(ff_pkt->fname, O_RDONLY);
+      fd = open(ff_pkt->fname, O_RDONLY|O_CLOEXEC);
       if (fd < 0) {
          Dmsg2(50, "Failed to open file: %s err: %d\n",
                ff_pkt->fname, errno);