mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
security: selinux: Label externalDataStore
We mirror the labeling strategy that was used for its top image 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
dbdf150b45
commit
36138eaecf
@ -1846,7 +1846,7 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr,
|
|||||||
virSecurityDeviceLabelDefPtr parent_seclabel = NULL;
|
virSecurityDeviceLabelDefPtr parent_seclabel = NULL;
|
||||||
char *use_label = NULL;
|
char *use_label = NULL;
|
||||||
bool remember;
|
bool remember;
|
||||||
bool is_toplevel = parent == src;
|
bool is_toplevel = parent == src || parent->externalDataStore == src;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!src->path || !virStorageSourceIsLocalStorage(src))
|
if (!src->path || !virStorageSourceIsLocalStorage(src))
|
||||||
@ -1933,6 +1933,14 @@ virSecuritySELinuxSetImageLabelRelative(virSecurityManagerPtr mgr,
|
|||||||
if (virSecuritySELinuxSetImageLabelInternal(mgr, def, n, parent) < 0)
|
if (virSecuritySELinuxSetImageLabelInternal(mgr, def, n, parent) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (n->externalDataStore &&
|
||||||
|
virSecuritySELinuxSetImageLabelRelative(mgr,
|
||||||
|
def,
|
||||||
|
n->externalDataStore,
|
||||||
|
parent,
|
||||||
|
flags) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (!(flags & VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN))
|
if (!(flags & VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user