]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
storage: fix dup_cloexec() call 3816/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 30 Apr 2021 08:35:06 +0000 (10:35 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 30 Apr 2021 08:35:06 +0000 (10:35 +0200)
Fixes: Coverity 1477399
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/storage/storage.c

index 061983a0a39f009d483c34699da091eef5625a63..514bdae30f8675ee8d576d8188ed8e04b4d6202a 100644 (file)
@@ -346,7 +346,7 @@ struct lxc_storage *storage_copy(struct lxc_container *c, const char *cname,
        orig = c->lxc_conf->rootfs.storage;
 
        if (c->lxc_conf->rootfs.dfd_idmapped >= 0) {
-               new_rootfs.dfd_idmapped = dup_cloexec(new_rootfs.dfd_idmapped);
+               new_rootfs.dfd_idmapped = dup_cloexec(c->lxc_conf->rootfs.dfd_idmapped);
                if (new_rootfs.dfd_idmapped < 0) {
                        SYSERROR("Failed to duplicate user namespace file descriptor");
                        lxc_storage_put(c->lxc_conf);