mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
security: selinux: break out SetImageLabelRelative
This will be used for recursing into externalDataStore 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
bbdf85d63a
commit
dbdf150b45
@ -1921,15 +1921,16 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr,
|
||||
|
||||
|
||||
static int
|
||||
virSecuritySELinuxSetImageLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
virStorageSourcePtr src,
|
||||
virSecurityDomainImageLabelFlags flags)
|
||||
virSecuritySELinuxSetImageLabelRelative(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
virStorageSourcePtr src,
|
||||
virStorageSourcePtr parent,
|
||||
virSecurityDomainImageLabelFlags flags)
|
||||
{
|
||||
virStorageSourcePtr n;
|
||||
|
||||
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
if (virSecuritySELinuxSetImageLabelInternal(mgr, def, n, src) < 0)
|
||||
if (virSecuritySELinuxSetImageLabelInternal(mgr, def, n, parent) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(flags & VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN))
|
||||
@ -1940,6 +1941,15 @@ virSecuritySELinuxSetImageLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virSecuritySELinuxSetImageLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
virStorageSourcePtr src,
|
||||
virSecurityDomainImageLabelFlags flags)
|
||||
{
|
||||
return virSecuritySELinuxSetImageLabelRelative(mgr, def, src, src, flags);
|
||||
}
|
||||
|
||||
struct virSecuritySELinuxMoveImageMetadataData {
|
||||
virSecurityManagerPtr mgr;
|
||||
const char *src;
|
||||
|
Loading…
x
Reference in New Issue
Block a user