]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Fix a file descriptor leak in the monitord spawn
authorVincent Giersch <vincent.giersch@ovh.net>
Wed, 11 Jun 2014 14:23:27 +0000 (16:23 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 8 Aug 2014 16:19:39 +0000 (12:19 -0400)
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/monitor.c
src/lxc/start.c

index f356adf2178ab770205375daa2cdcd26a00ab555..7c6dbb4a565cefaa658fe7fef23953f8f69d984c 100644 (file)
@@ -319,6 +319,7 @@ int lxc_monitord_spawn(const char *lxcpath)
                SYSERROR("failed to setsid");
                exit(EXIT_FAILURE);
        }
+       lxc_check_inherited(NULL, pipefd[1]);
        close(0);
        close(1);
        close(2);
index bb136af0d8e42175e417cf061d231fadc8591c27..60f07772f7278f98ff11b160049f81379920da61 100644 (file)
@@ -203,7 +203,7 @@ restart:
                if (match_fd(fd))
                        continue;
 
-               if (conf->close_all_fds) {
+               if (conf == NULL || conf->close_all_fds) {
                        close(fd);
                        closedir(dir);
                        INFO("closed inherited fd %d", fd);