]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: always use target_fd in userns_exec_mapped_root()
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 11 Jun 2020 16:05:33 +0000 (18:05 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 11 Jun 2020 16:19:31 +0000 (18:19 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 115555cd10f57b0dadd39abfed8e21754e2f7650..41918912cac9ed8b08f4aeda175f5bd17b7234a8 100644 (file)
@@ -4633,7 +4633,7 @@ int userns_exec_mapped_root(const char *path, int path_fd,
                if (!lxc_setgroups(0, NULL))
                        _exit(EXIT_FAILURE);
 
-               ret = chown(path, 0, st.st_gid);
+               ret = fchown(target_fd, 0, st.st_gid);
                if (ret) {
                        SYSERROR("Failed to chown \"%s\"", path);
                        _exit(EXIT_FAILURE);