]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't set NVRAM label when creating it
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Jun 2021 13:44:11 +0000 (15:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Jun 2021 07:15:09 +0000 (09:15 +0200)
commitfb1289c15516145517ccab971182d80bc1b8ccc9
treefc455bc2f76d02e08e8b6f5d24da00cf117e31cc
parent56dcdec1ac8104f94371c210585bab91eb36395d
qemu: Don't set NVRAM label when creating it

The NVRAM label is set in qemuSecuritySetAllLabel(). There's no
need to set its label upfront. In fact, setting it twice creates
an imbalance because it's unset only once which mangles seclabel
remembering. However, plain removal of the
qemuSecurityDomainSetPathLabel() undoes the fix for the original
bug (when dynamic ownership is off then the NVRAM is not created
with cfg->user and cfg->group but as root:root). Therefore, we
have to switch to virFileOpenAs() and pass cfg->user and
cfg->group and VIR_FILE_OPEN_FORCE_OWNER flag. There's no need to
pass VIR_FILE_OPEN_FORCE_MODE because the file will be created
with the proper mode.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1969347
Fixes: bcdaa91a27b5b2d103535270a6a287efe6cd8bfb
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_process.c