Commit 5332bb84 by Daniel Lezcano Committed by Daniel Lezcano

Don't close fd 0, fd 1

That breaks the reboot because when we reexec, fd 0 and fd 1 will be closed and these one are created by lxc, not inherited. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 1362f2eb
...@@ -1373,6 +1373,9 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf) ...@@ -1373,6 +1373,9 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf)
return -1; return -1;
} }
DEBUG("allocated pty '%s' (%d/%d)",
pty_info->name, pty_info->master, pty_info->slave);
/* Prevent leaking the file descriptors to the container */ /* Prevent leaking the file descriptors to the container */
fcntl(pty_info->master, F_SETFD, FD_CLOEXEC); fcntl(pty_info->master, F_SETFD, FD_CLOEXEC);
fcntl(pty_info->slave, F_SETFD, FD_CLOEXEC); fcntl(pty_info->slave, F_SETFD, FD_CLOEXEC);
......
...@@ -600,10 +600,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf) ...@@ -600,10 +600,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf)
goto out_fini; goto out_fini;
} }
/* no need of other inherited fds but stderr */
close(fileno(stdin));
close(fileno(stdout));
err = lxc_poll(name, handler); err = lxc_poll(name, handler);
if (err) { if (err) {
ERROR("mainloop exited with an error"); ERROR("mainloop exited with an error");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment