]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: fix wrong path on overlayfs
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 12 Jun 2017 09:18:05 +0000 (11:18 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 13 Jun 2017 04:13:20 +0000 (06:13 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index e0a13ef74d84eadf89cdd4d0dbfe035be6cf8f69..d3a9c61daefcb412ff7ceef080f791c05ca5ed7a 100644 (file)
@@ -3771,12 +3771,16 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
                return 0;
        }
 
-       // save the current gid of "path"
+       /* save the current gid of "path" */
        if (stat(path, &sb) < 0) {
                ERROR("Error stat %s", path);
                return -1;
        }
 
+       /* Update the path argument in case this was overlayfs. */
+       args1[sizeof(args1) / sizeof(args1[0]) - 2] = path;
+       args2[sizeof(args2) / sizeof(args2[0]) - 2] = path;
+
        /*
         * A file has to be group-owned by a gid mapped into the
         * container, or the container won't be privileged over it.