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>
This commit is contained in:
Peter Krempa 2019-02-04 16:24:15 +01:00
parent 41d37d31b3
commit 620d9dd598

View File

@ -4524,7 +4524,8 @@ virQEMUCapsInitQMPCommandRun(virQEMUCapsInitQMPCommandPtr cmd,
#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);