提交 5daa1b01 编写于 作者: G Gao feng 提交者: Daniel P. Berrange

LXC: fuse: Change files owner to the root user of container

The owner of the /proc/meminfo in container should
be the root user of container.
Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
上级 6c7665e1
......@@ -48,6 +48,8 @@ static int lxcProcGetattr(const char *path, struct stat *stbuf)
int res;
char *mempath = NULL;
struct stat sb;
struct fuse_context *context = fuse_get_context();
virDomainDefPtr def = (virDomainDefPtr)context->private_data;
memset(stbuf, 0, sizeof(struct stat));
if (virAsprintf(&mempath, "/proc/%s", path) < 0) {
......@@ -66,6 +68,8 @@ static int lxcProcGetattr(const char *path, struct stat *stbuf)
goto cleanup;
}
stbuf->st_uid = def->idmap.uidmap ? def->idmap.uidmap[0].target : 0;
stbuf->st_gid = def->idmap.gidmap ? def->idmap.gidmap[0].target : 0;
stbuf->st_mode = sb.st_mode;
stbuf->st_nlink = 1;
stbuf->st_blksize = sb.st_blksize;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册