mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
storage: fix crash in luks encrypted volume creation
Fix the case when creating a luks encrypted volume via an xml file without 'secret' element. libvirtd was receiving SIGSEGV, now proper error is reported for the missing element. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468422 Signed-off-by: Katerina Koukiou <kkoukiou@redhat.com>
This commit is contained in:
parent
f982c92c8f
commit
fab2e49d3c
@ -1277,6 +1277,13 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (enc->nsecrets != 1) {
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
|
_("A single <secret type='passphrase'...> "
|
||||||
|
"element is expected in encryption description"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
conn = virGetConnectSecret();
|
conn = virGetConnectSecret();
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user