From 2570cdf3fe541ae9ccff5c40efe66cf8944f6f86 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 30 Apr 2021 10:35:06 +0200 Subject: [PATCH] storage: fix dup_cloexec() call Fixes: Coverity 1477399 Signed-off-by: Christian Brauner --- src/lxc/storage/storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2