From: John Ferlan Date: Tue, 12 Feb 2019 13:35:38 +0000 (-0500) Subject: conf: Check for duplicate authdef during hostdev iSCSI processing X-Git-Tag: v5.1.0-rc1~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=466a3e5dfac24e4cd5966e12047517494d4ffa5d;p=thirdparty%2Flibvirt.git conf: Check for duplicate authdef during hostdev iSCSI processing If virDomainHostdevSubsysSCSIiSCSIDefParseXML processing finds a duplicated structure, we should error out rather than continue. Signed-off-by: John Ferlan Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9e46cf721b..2d75849e3d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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 definition already found for " + "the iSCSI definition")); + return -1; + } if (!(authdef = virStorageAuthDefParse(cur, ctxt))) return -1; if ((auth_secret_usage =