mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 03:21:44 +03:00
security: selinux: Drop !parent handling in SetImageLabelInternal
The only caller always passes in a non-null parent Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
6f1cd0a54e
commit
65181d419e
@ -1851,9 +1851,8 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr,
|
||||
|
||||
disk_seclabel = virStorageSourceGetSecurityLabelDef(src,
|
||||
SECURITY_SELINUX_NAME);
|
||||
if (parent)
|
||||
parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,
|
||||
SECURITY_SELINUX_NAME);
|
||||
parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,
|
||||
SECURITY_SELINUX_NAME);
|
||||
|
||||
if (disk_seclabel && (!disk_seclabel->relabel || disk_seclabel->label)) {
|
||||
if (!disk_seclabel->relabel)
|
||||
@ -1865,7 +1864,7 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr,
|
||||
return 0;
|
||||
|
||||
use_label = parent_seclabel->label;
|
||||
} else if (!parent || parent == src) {
|
||||
} else if (parent == src) {
|
||||
if (src->shared) {
|
||||
use_label = data->file_context;
|
||||
} else if (src->readonly) {
|
||||
|
Loading…
Reference in New Issue
Block a user