mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +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)
|
if (!secdef)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
|
if ((secdef->type == VIR_DOMAIN_SECLABEL_STATIC) ||
|
||||||
|
(secdef->type == VIR_DOMAIN_SECLABEL_NONE))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (secdef->baselabel) {
|
if (secdef->baselabel) {
|
||||||
@ -580,6 +581,9 @@ AppArmorSetSecurityProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
|||||||
if (!secdef)
|
if (!secdef)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (secdef->label == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if ((profile_name = get_profile_name(def)) == NULL)
|
if ((profile_name = get_profile_name(def)) == NULL)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
@ -626,6 +630,9 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
|||||||
if (!secdef)
|
if (!secdef)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (secdef->label == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (STRNEQ(SECURITY_APPARMOR_NAME, secdef->model)) {
|
if (STRNEQ(SECURITY_APPARMOR_NAME, secdef->model)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("security label driver mismatch: "
|
_("security label driver mismatch: "
|
||||||
|
Loading…
Reference in New Issue
Block a user