[lxc-devel] the lxc.tty option leaks file descriptors
Môshe van der Sterre
me at moshe.nl
Thu Apr 9 06:23:52 UTC 2009
On Wed, 08 Apr 2009 22:42:56 +0200, Môshe van der Sterre <me at moshe.nl>
wrote:
> This patch seems to fix it, is this the correct approach?
The call to lxc_delete_tty should have been after the call to lxc_setup.
Sorry for the wrong patch.
I did some more testing and code reading, and as far as I can tell, it
works as expected.
All comments are greatly appreciated!
diff --git a/src/lxc/start.c b/src/lxc/start.c
index de355af..b4baddd 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -374,6 +374,9 @@ int lxc_start(const char *name, char *argv[])
goto out_child;
}
+ /* The child does not need the tty file descriptors */
+ lxc_delete_tty(&tty_info);
+
if (prctl(PR_CAPBSET_DROP, CAP_SYS_BOOT, 0, 0, 0)) {
lxc_log_syserror("failed to remove CAP_SYS_BOOT
capability");
goto out_child;
More information about the lxc-devel
mailing list