mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virSecurityManagerGenLabel: Skip seclabels without model
While generating seclabels, we check the seclabel stack if required
driver is in the stack. If not, an error is returned. However, it is
possible for a seclabel to not have any model set (happens with LXC
domains that have just <seclabel type='none'>). If that's the case,
we should just skip the iteration instead of calling STREQ(NULL, ...)
and SIGSEGV-ing subsequently.
(cherry picked from commit ba44dd2453
)
This commit is contained in:
parent
06e612e9b1
commit
c5433874fd
@ -450,6 +450,9 @@ int virSecurityManagerGenLabel(virSecurityManagerPtr mgr,
|
||||
|
||||
virObjectLock(mgr);
|
||||
for (i = 0; i < vm->nseclabels; i++) {
|
||||
if (!vm->seclabels[i]->model)
|
||||
continue;
|
||||
|
||||
for (j = 0; sec_managers[j]; j++)
|
||||
if (STREQ(vm->seclabels[i]->model, sec_managers[j]->drv->name))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user