Skip to content

Commit

Permalink
execute: pass /proc/self/fd/<nr>
Browse files Browse the repository at this point in the history
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: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Mrinal Dhillon <mdhillon@juniper.net>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent f24e4d0 commit bf58a98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/execute.c
Expand Up @@ -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;

Expand Down

0 comments on commit bf58a98

Please sign in to comment.