mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 08:35:22 +00:00
lxc: Don't crash if no security driver is specified in libvirt_lxc
When no security driver is specified libvirt_lxc segfaults as a debug message tries to access security labels for the container that are not present. This problem was introduced in commit6c3cf57d6c
. (cherry picked from commit99a388e612
)
This commit is contained in:
parent
fac1a19dfc
commit
bf8efc3398
@ -1589,11 +1589,15 @@ int main(int argc, char *argv[])
|
||||
false, false, false)))
|
||||
goto cleanup;
|
||||
|
||||
VIR_DEBUG("Security model %s type %s label %s imagelabel %s",
|
||||
NULLSTR(ctrl->def->seclabels[0]->model),
|
||||
virDomainSeclabelTypeToString(ctrl->def->seclabels[0]->type),
|
||||
NULLSTR(ctrl->def->seclabels[0]->label),
|
||||
NULLSTR(ctrl->def->seclabels[0]->imagelabel));
|
||||
if (ctrl->def->seclabels) {
|
||||
VIR_DEBUG("Security model %s type %s label %s imagelabel %s",
|
||||
NULLSTR(ctrl->def->seclabels[0]->model),
|
||||
virDomainSeclabelTypeToString(ctrl->def->seclabels[0]->type),
|
||||
NULLSTR(ctrl->def->seclabels[0]->label),
|
||||
NULLSTR(ctrl->def->seclabels[0]->imagelabel));
|
||||
} else {
|
||||
VIR_DEBUG("Security model not initialized");
|
||||
}
|
||||
|
||||
ctrl->veths = veths;
|
||||
ctrl->nveths = nveths;
|
||||
|
Loading…
Reference in New Issue
Block a user