From: S.Çağlar Onur Date: Fri, 22 Aug 2014 19:53:09 +0000 (-0400) Subject: use lxcpath as unprivileged containers log directory X-Git-Tag: lxc-1.1.0.alpha2~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=361e0e3c08fa9f0bb0ff782fc30d52f391ebfaa1;p=thirdparty%2Flxc.git use lxcpath as unprivileged containers log directory Signed-off-by: S.Çağlar Onur Acked-by: Stéphane Graber --- diff --git a/src/lxc/log.c b/src/lxc/log.c index d5b862e61..b6b393157 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -329,11 +329,6 @@ extern int lxc_log_init(const char *name, const char *file, return 0; ret = __lxc_log_set_file(file, 1); } else { - - /* For now, unprivileged containers have to set -l to get logging */ - if (geteuid()) - return 0; - /* if no name was specified, there nothing to do */ if (!name) return 0; @@ -343,8 +338,8 @@ extern int lxc_log_init(const char *name, const char *file, if (!lxcpath) lxcpath = LOGPATH; - /* try LOGPATH if lxcpath is the default */ - if (strcmp(lxcpath, lxc_global_config_value("lxc.lxcpath")) == 0) + /* try LOGPATH if lxcpath is the default for the privileged containers */ + if (!geteuid() && strcmp(lxcpath, lxc_global_config_value("lxc.lxcpath")) == 0) ret = _lxc_log_set_file(name, NULL, 0); /* try in lxcpath */