From bf58a9801305da3c79ec40e1b09d5c76999fd46a Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 23 Aug 2018 17:35:40 +0200 Subject: [PATCH] execute: pass /proc/self/fd/ Passing /proc/1/fd/ presupposes that CLONE_NEWPID was specified. This isn't the case when users use lxc.namespace.keep = pid to inherit pid namespaces. Pass /proc/self/fd/ instead. Signed-off-by: Christian Brauner Reported-by: Mrinal Dhillon --- src/lxc/execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/execute.c b/src/lxc/execute.c index 26b8fa8647..dc23bb3ea7 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -95,7 +95,7 @@ static int execute_start(struct lxc_handler *handler, void* data) goto out2; } - ret = snprintf(logfile, sizeof(logfile), "/proc/1/fd/%d", logfd); + ret = snprintf(logfile, sizeof(logfile), "/proc/self/fd/%d", logfd); if (ret < 0 || (size_t)ret >= sizeof(logfile)) goto out3;