From: Christian Brauner Date: Tue, 23 Feb 2021 17:59:07 +0000 (+0100) Subject: attach: fix unsupported namespaces X-Git-Tag: lxc-5.0.0~273^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb54db2c34e8ccde64eacc73ea55afa5e15d9e82;p=thirdparty%2Flxc.git attach: fix unsupported namespaces Signed-off-by: Christian Brauner --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 7bc6db120..200a106c4 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -513,7 +513,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path) if (ns_fd2 < 0) { /* The kernel does not support this namespace. This is not an error. */ if (errno == ENOENT) - return -EINVAL; + return -ENOENT; return log_error_errno(-errno, errno, "Failed to open %d(%s)", dfd_pid2, ns_path); } @@ -573,7 +573,7 @@ static int __prepare_namespaces_nsfd(struct attach_context *ctx, if (ctx->ns_fd[i] >= 0) continue; - if (ctx->ns_fd[i] == -EINVAL) { + if (ctx->ns_fd[i] == -ENOENT) { ctx->ns_inherited &= ~ns_info[i].clone_flag; continue; }