[lxc-devel] [PATCH] daemonize implies close_all_fds so set it in lxcapi_want_daemonize instead of setting in every cli or in every binding explicitly
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Oct 30 20:33:01 UTC 2013
Quoting S.Çağlar Onur (caglar at 10ur.org):
> Reported-by: Fatih Arslan <ftharsln at gmail.com>
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/lxc/lxc_start.c | 2 +-
> src/lxc/lxccontainer.c | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
> index 2e3c3b3..add2542 100644
> --- a/src/lxc/lxc_start.c
> +++ b/src/lxc/lxc_start.c
> @@ -96,7 +96,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
> switch (c) {
> case 'c': args->console = arg; break;
> case 'L': args->console_log = arg; break;
> - case 'd': args->daemonize = 1; args->close_all_fds = 1; break;
> + case 'd': args->daemonize = 1; break;
> case 'f': args->rcfile = arg; break;
> case 'C': args->close_all_fds = 1; break;
> case 's': return lxc_config_define_add(&defines, arg);
> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> index 1254dc0..8b81a63 100644
> --- a/src/lxc/lxccontainer.c
> +++ b/src/lxc/lxccontainer.c
> @@ -459,6 +459,8 @@ static void lxcapi_want_daemonize(struct lxc_container *c)
> return;
> }
> c->daemonize = 1;
> + /* daemonize implies close_all_fds so set it */
> + c->lxc_conf->close_all_fds = 1;
> container_mem_unlock(c);
> }
>
> --
> 1.8.3.2
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list