From f620ed4433db0f57b60267ed4bebbb12ab8e87d6 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 18 Mar 2021 10:40:13 +0100 Subject: [PATCH] attach: visually separate pids from fds during initalization Signed-off-by: Christian Brauner --- src/lxc/attach.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 04c8efc60..f2f68f5c3 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -181,10 +181,12 @@ static struct attach_context *alloc_attach_context(void) if (!ctx) return ret_set_errno(NULL, ENOMEM); + ctx->init_pid = -ESRCH; + ctx->dfd_self_pid = -EBADF; ctx->dfd_init_pid = -EBADF; ctx->init_pidfd = -EBADF; - ctx->init_pid = -ESRCH; + ctx->setup_ns_uid = LXC_INVALID_UID; ctx->setup_ns_gid = LXC_INVALID_GID; ctx->target_ns_uid = LXC_INVALID_UID; -- 2.47.2