]> git.proxmox.com Git - mirror_lxc.git/commitdiff
use lxcpath as unprivileged containers log directory
authorS.Çağlar Onur <caglar@10ur.org>
Fri, 22 Aug 2014 19:53:09 +0000 (15:53 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 22 Aug 2014 21:48:29 +0000 (16:48 -0500)
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/log.c

index d5b862e61a7f641e78bf549b952bf2f2c2bde028..b6b393157a6b2f571f95621819ba9b5ad2bf222a 100644 (file)
@@ -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 */