Commit 361e0e3c by S.Çağlar Onur Committed by Stéphane Graber

use lxcpath as unprivileged containers log directory

parent 614305f3
...@@ -329,11 +329,6 @@ extern int lxc_log_init(const char *name, const char *file, ...@@ -329,11 +329,6 @@ extern int lxc_log_init(const char *name, const char *file,
return 0; return 0;
ret = __lxc_log_set_file(file, 1); ret = __lxc_log_set_file(file, 1);
} else { } 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 no name was specified, there nothing to do */
if (!name) if (!name)
return 0; return 0;
...@@ -343,8 +338,8 @@ extern int lxc_log_init(const char *name, const char *file, ...@@ -343,8 +338,8 @@ extern int lxc_log_init(const char *name, const char *file,
if (!lxcpath) if (!lxcpath)
lxcpath = LOGPATH; lxcpath = LOGPATH;
/* try LOGPATH if lxcpath is the default */ /* try LOGPATH if lxcpath is the default for the privileged containers */
if (strcmp(lxcpath, lxc_global_config_value("lxc.lxcpath")) == 0) if (!geteuid() && strcmp(lxcpath, lxc_global_config_value("lxc.lxcpath")) == 0)
ret = _lxc_log_set_file(name, NULL, 0); ret = _lxc_log_set_file(name, NULL, 0);
/* try in lxcpath */ /* try in lxcpath */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment