mirror of https://gitee.com/openkylin/libvirt.git
virSecuritySELinuxRestoreAllLabel: Restore more labels
We are setting label on kernel, initrd, dtb and slic_table files. But we never restored it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d81f3e02d7
commit
d9043c06e6
|
@ -2668,6 +2668,22 @@ virSecuritySELinuxRestoreAllLabel(virSecurityManagerPtr mgr,
|
|||
virSecuritySELinuxRestoreFileLabel(mgr, def->os.loader->nvram, false) < 0)
|
||||
rc = -1;
|
||||
|
||||
if (def->os.kernel &&
|
||||
virSecuritySELinuxRestoreFileLabel(mgr, def->os.kernel, false) < 0)
|
||||
rc = -1;
|
||||
|
||||
if (def->os.initrd &&
|
||||
virSecuritySELinuxRestoreFileLabel(mgr, def->os.initrd, false) < 0)
|
||||
rc = -1;
|
||||
|
||||
if (def->os.dtb &&
|
||||
virSecuritySELinuxRestoreFileLabel(mgr, def->os.dtb, false) < 0)
|
||||
rc = -1;
|
||||
|
||||
if (def->os.slic_table &&
|
||||
virSecuritySELinuxRestoreFileLabel(mgr, def->os.slic_table, false) < 0)
|
||||
rc = -1;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue