]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: fix unsupported namespaces
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 23 Feb 2021 17:59:07 +0000 (18:59 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 23 Feb 2021 17:59:07 +0000 (18:59 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 7bc6db1208a61e951bbedfdb34ba4f1b889eabd9..200a106c4a74664a9c2f2769970b2846df9591ce 100644 (file)
@@ -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;
                }