提交 fab2e49d 编写于 作者: K Katerina Koukiou

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=1468422Signed-off-by: NKaterina Koukiou <kkoukiou@redhat.com>
上级 f982c92c
......@@ -1277,6 +1277,13 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
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();
if (!conn)
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册