mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
selinux: Only close the selabel_handle once
On selinux driver initialization failure (missing/incorrectly
formatted contexts file), selabel_handle was closed twice.
Introduced by 6159710
.
This commit is contained in:
parent
bc3070c719
commit
f1bdcb2be9
@ -460,6 +460,7 @@ virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr)
|
|||||||
error:
|
error:
|
||||||
# if HAVE_SELINUX_LABEL_H
|
# if HAVE_SELINUX_LABEL_H
|
||||||
selabel_close(data->label_handle);
|
selabel_close(data->label_handle);
|
||||||
|
data->label_handle = NULL;
|
||||||
# endif
|
# endif
|
||||||
virConfFree(selinux_conf);
|
virConfFree(selinux_conf);
|
||||||
VIR_FREE(data->domain_context);
|
VIR_FREE(data->domain_context);
|
||||||
@ -547,6 +548,7 @@ virSecuritySELinuxQEMUInitialize(virSecurityManagerPtr mgr)
|
|||||||
error:
|
error:
|
||||||
#if HAVE_SELINUX_LABEL_H
|
#if HAVE_SELINUX_LABEL_H
|
||||||
selabel_close(data->label_handle);
|
selabel_close(data->label_handle);
|
||||||
|
data->label_handle = NULL;
|
||||||
#endif
|
#endif
|
||||||
VIR_FREE(data->domain_context);
|
VIR_FREE(data->domain_context);
|
||||||
VIR_FREE(data->alt_domain_context);
|
VIR_FREE(data->alt_domain_context);
|
||||||
@ -808,7 +810,8 @@ virSecuritySELinuxSecurityDriverClose(virSecurityManagerPtr mgr)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if HAVE_SELINUX_LABEL_H
|
#if HAVE_SELINUX_LABEL_H
|
||||||
selabel_close(data->label_handle);
|
if (data->label_handle)
|
||||||
|
selabel_close(data->label_handle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virHashFree(data->mcs);
|
virHashFree(data->mcs);
|
||||||
|
Loading…
Reference in New Issue
Block a user