From: Aki Tuomi Date: Tue, 29 Jul 2025 11:19:41 +0000 (+0300) Subject: lib-master: Ensure cache fd is closed on exec X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cb5306a93f44891fc4782c55b9e9b09a803782a;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Ensure cache fd is closed on exec Prevents it from leaking by accident. --- diff --git a/src/lib-master/master-service-settings.c b/src/lib-master/master-service-settings.c index acdeab09e1..7d10707f3d 100644 --- a/src/lib-master/master-service-settings.c +++ b/src/lib-master/master-service-settings.c @@ -337,6 +337,8 @@ static int master_service_binary_config_cache_get(const char *cache_dir, int fd = open(cache_path, O_RDONLY); if (fd == -1 && errno != ENOENT) i_error("Binary config cache: open(%s) failed: %m", cache_path); + else if (fd != -1) + fd_close_on_exec(fd, TRUE); return fd; }