mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
conf: Check for duplicate authdef during hostdev iSCSI processing
If virDomainHostdevSubsysSCSIiSCSIDefParseXML processing finds a duplicated <auth> structure, we should error out rather than continue. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bc096fc4a2
commit
466a3e5dfa
@ -7616,6 +7616,12 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode,
|
||||
while (cur != NULL) {
|
||||
if (cur->type == XML_ELEMENT_NODE &&
|
||||
virXMLNodeNameEqual(cur, "auth")) {
|
||||
if (iscsisrc->src->auth) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("an <auth> definition already found for "
|
||||
"the <hostdev> iSCSI definition"));
|
||||
return -1;
|
||||
}
|
||||
if (!(authdef = virStorageAuthDefParse(cur, ctxt)))
|
||||
return -1;
|
||||
if ((auth_secret_usage =
|
||||
|
Loading…
x
Reference in New Issue
Block a user