提交 63af64d7 编写于 作者: M Michal Privoznik

qemu_shim: Allow other users to enter the root dir

When virt-qemu-run is ran without any root directory specified on
the command line, a temporary directory is made and used instead.
But since we are using g_dir_make_tmp() to create the directory
it is going to have 0700 mode. So even though we create the whole
directory structure under it and label everything, QEMU is very
likely to not have the access. This is because in this case there
is no qemu.conf and thus distro default UID:GID is used to run
QEMU (e.g. qemu:kvm on Fedora). Change the mode of the temporary
directory so that everybody has eXecute permission.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
上级 6799b72d
......@@ -158,6 +158,12 @@ int main(int argc, char **argv)
return 1;
}
tmproot = true;
if (chmod(root, 0755) < 0) {
g_printerr("%s: cannot chown temporary dir: %s\n",
argv[0], g_strerror(errno));
goto cleanup;
}
}
virFileActivateDirOverrideForProg(argv[0]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册