execute: pass /proc/self/fd/<nr>

Passing /proc/1/fd/<nr> 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/<nr> instead. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com> Reported-by: 's avatarMrinal Dhillon <mdhillon@juniper.net>
parent f24e4d00
...@@ -95,7 +95,7 @@ static int execute_start(struct lxc_handler *handler, void* data) ...@@ -95,7 +95,7 @@ static int execute_start(struct lxc_handler *handler, void* data)
goto out2; 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)) if (ret < 0 || (size_t)ret >= sizeof(logfile))
goto out3; goto out3;
......
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