forked from pool/libvirt
61b77bff2e
- qemu: don't use CAP_DAC_OVERRIDE capability if non-root 620d9dd5-qemu-no-dac-override-nonroot.patch boo#1125665 OBS-URL: https://build.opensuse.org/request/show/677536 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=730
26 lines
996 B
Diff
26 lines
996 B
Diff
commit 620d9dd598fde388f56ac37bcd3b31168c2f9fc6
|
|
Author: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Mon Feb 4 16:24:15 2019 +0100
|
|
|
|
qemu: caps: Don't try to ask for CAP_DAC_OVERRIDE if non-root
|
|
|
|
It will not work. This breaks qemu capabilities probing as a user.
|
|
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Reviewed-by: Erik Skultety <eskultet@redhat.com>
|
|
|
|
Index: libvirt-5.0.0/src/qemu/qemu_capabilities.c
|
|
===================================================================
|
|
--- libvirt-5.0.0.orig/src/qemu/qemu_capabilities.c
|
|
+++ libvirt-5.0.0/src/qemu/qemu_capabilities.c
|
|
@@ -4529,7 +4529,8 @@ virQEMUCapsInitQMPCommandRun(virQEMUCaps
|
|
#if WITH_CAPNG
|
|
/* QEMU might run into permission issues, e.g. /dev/sev (0600), override
|
|
* them just for the purpose of probing */
|
|
- virCommandAllowCap(cmd->cmd, CAP_DAC_OVERRIDE);
|
|
+ if (geteuid() == 0)
|
|
+ virCommandAllowCap(cmd->cmd, CAP_DAC_OVERRIDE);
|
|
#endif
|
|
|
|
virCommandSetGID(cmd->cmd, cmd->runGid);
|