]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Ensure cache fd is closed on exec
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Jul 2025 11:19:41 +0000 (14:19 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Jul 2025 11:29:25 +0000 (14:29 +0300)
Prevents it from leaking by accident.

src/lib-master/master-service-settings.c

index acdeab09e141a177fc3b2a4e023ea2f4141a23df..7d10707f3da54f6c26db55fe9819e7df135392fa 100644 (file)
@@ -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;
 }