From: Christian Brauner Date: Fri, 30 Apr 2021 08:35:06 +0000 (+0200) Subject: storage: fix dup_cloexec() call X-Git-Tag: lxc-5.0.0~186^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3816%2Fhead;p=thirdparty%2Flxc.git storage: fix dup_cloexec() call Fixes: Coverity 1477399 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c index 061983a0a..514bdae30 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -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);