From: Cole Robinson Date: Mon, 7 Oct 2019 20:20:12 +0000 (-0400) Subject: security: dac: Label externalDataStore X-Git-Tag: v5.9.0-rc1~285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efe3575e60697ac8e55e16393b9e7cc56af598d5;p=thirdparty%2Flibvirt.git security: dac: Label externalDataStore We mirror the labeling strategy that was used for its sibling image Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik Signed-off-by: Cole Robinson --- diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 3edfb8f9f4..d6d0a8299b 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -884,7 +884,7 @@ virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr, 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; @@ -948,6 +948,14 @@ virSecurityDACSetImageLabelRelative(virSecurityManagerPtr mgr, 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; }