[lxc-devel] [PATCH] Disable logpath for unprivileged containers

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jan 15 18:54:41 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/log.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/lxc/log.c b/src/lxc/log.c
> index b09885c..4a2b7eb 100644
> --- a/src/lxc/log.c
> +++ b/src/lxc/log.c
> @@ -318,6 +318,11 @@ extern int lxc_log_init(const char *name, const char *file,
>  		lxc_logfile_specified = 1;
>  		ret = __lxc_log_set_file(file, 1);
>  	} else {
> +
> +		/* For now, unprivileged containers have to set -l to get logging */
> +		if (geteuid())
> +			return 0;
> +
>  		ret = -1;
>  
>  		if (!lxcpath)
> -- 
> 1.8.5.2
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list