From: Christian Brauner Date: Mon, 12 Jun 2017 09:18:05 +0000 (+0200) Subject: conf: fix wrong path on overlayfs X-Git-Tag: lxc-2.1.0~98^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbdbf8f078319cdeea69ad43866446c59496d430;p=thirdparty%2Flxc.git conf: fix wrong path on overlayfs Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index e0a13ef74..d3a9c61da 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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.