apparmor: handle "none" type

This commit is contained in:
Cédric Bosdonnat 2014-03-03 11:26:46 +01:00 committed by Daniel P. Berrange
parent ef7dc7d429
commit 9194ccecf1

View File

@ -417,7 +417,8 @@ AppArmorGenSecurityLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
if (!secdef)
return -1;
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
if ((secdef->type == VIR_DOMAIN_SECLABEL_STATIC) ||
(secdef->type == VIR_DOMAIN_SECLABEL_NONE))
return 0;
if (secdef->baselabel) {
@ -580,6 +581,9 @@ AppArmorSetSecurityProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
if (!secdef)
return -1;
if (secdef->label == NULL)
return 0;
if ((profile_name = get_profile_name(def)) == NULL)
return rc;
@ -626,6 +630,9 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
if (!secdef)
goto cleanup;
if (secdef->label == NULL)
return 0;
if (STRNEQ(SECURITY_APPARMOR_NAME, secdef->model)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("security label driver mismatch: "