We mirror the labeling strategy that was used for its sibling
image
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
virSecurityDeviceLabelDefPtr parent_seclabel = NULL;
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
bool remember;
- bool is_toplevel = parent == src;
+ bool is_toplevel = parent == src || parent->externalDataStore == src;
uid_t user;
gid_t group;
if (virSecurityDACSetImageLabelInternal(mgr, def, n, parent) < 0)
return -1;
+ if (n->externalDataStore &&
+ virSecurityDACSetImageLabelRelative(mgr,
+ def,
+ n->externalDataStore,
+ parent,
+ flags) < 0)
+ return -1;
+
if (!(flags & VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN))
break;
}