mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
selinux: Drop dead code in virSecuritySELinuxSetImageLabelInternal()
Considering that at the virSecuritySELinuxSetFilecon() function can only return 0 or -1 and so does the virSecuritySELinuxFSetFilecon(), the check for '1' at the end of virSecuritySELinuxSetImageLabelInternal() is effectively a dead code. Drop it. Co-developed-by: sdl.qemu <sdl.qemu@linuxtesting.org> Signed-off-by: Sergey Mironov <mironov@fintech.ru> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c80f0852ca
commit
a97b428208
@ -1988,17 +1988,6 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManager *mgr,
|
|||||||
ret = virSecuritySELinuxSetFilecon(mgr, path, use_label, remember);
|
ret = virSecuritySELinuxSetFilecon(mgr, path, use_label, remember);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 1 && !disk_seclabel) {
|
|
||||||
/* If we failed to set a label, but virt_use_nfs let us
|
|
||||||
* proceed anyway, then we don't need to relabel later. */
|
|
||||||
disk_seclabel = virSecurityDeviceLabelDefNew(SECURITY_SELINUX_NAME);
|
|
||||||
if (!disk_seclabel)
|
|
||||||
return -1;
|
|
||||||
disk_seclabel->labelskip = true;
|
|
||||||
VIR_APPEND_ELEMENT(src->seclabels, src->nseclabels, disk_seclabel);
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user