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>
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;