提交 2a6825c3 编写于 作者: D Daniel P. Berrange

Automatically set correct ownership of QEMU state directories

* src/qemu_driver.c: Change ownership of /var/{lib,cache}/libvirt/qemu
  to match user/group that QEMU VMs are configured to run as.
上级 182a80b9
......@@ -572,6 +572,21 @@ qemudStartup(int privileged) {
goto error;
}
if (privileged) {
if (chown(qemu_driver->libDir, qemu_driver->user, qemu_driver->group) < 0) {
virReportSystemError(NULL, errno,
_("unable to set ownership of '%s' to user %d:%d"),
qemu_driver->libDir, qemu_driver->user, qemu_driver->group);
goto error;
}
if (chown(qemu_driver->cacheDir, qemu_driver->user, qemu_driver->group) < 0) {
virReportSystemError(NULL, errno,
_("unable to set ownership of '%s' to %d:%d"),
qemu_driver->cacheDir, qemu_driver->user, qemu_driver->group);
goto error;
}
}
if (qemudSecurityInit(qemu_driver) < 0) {
goto error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册