]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Only use LOGPATH if lxcpath is unset or default
authorMichal Grzedzicki <lazy404@gmail.com>
Tue, 21 Jul 2015 08:29:00 +0000 (10:29 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 28 Aug 2015 22:05:37 +0000 (18:05 -0400)
Signed-off-by: Michał Grzędzicki <lazy404@gmail.com>
src/lxc/log.c

index c2dba7b950e405a767a8e625fec68043b2d44bc7..4796fe91ee94d6b0c41f281607d7f422c0fd4b01 100644 (file)
@@ -350,8 +350,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, lxcpath) == 0)
                        ret = _lxc_log_set_file(name, NULL, 0);
 
                /* try in lxcpath */