From: Eric Bollengier Date: Mon, 4 Jul 2022 08:13:32 +0000 (+0200) Subject: Fix #9292 about file descriptor leak with the HonorNoDumpFlag fileset option X-Git-Tag: Release-13.0.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3d68bf928a19a2bfbb959f01d8c6a7a5117c4f6;p=thirdparty%2Fbacula.git Fix #9292 about file descriptor leak with the HonorNoDumpFlag fileset option --- diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 4acfd4121..9a4b771f0 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -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);