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

Stéphane Graber stgraber at ubuntu.com
Wed Jan 15 18:39:16 UTC 2014


Signed-off-by: Stéphane Graber <stgraber 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



More information about the lxc-devel mailing list