mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
apparmor: handle "none" type
This commit is contained in:
parent
ef7dc7d429
commit
9194ccecf1
@ -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: "
|
||||
|
Loading…
Reference in New Issue
Block a user