From: Kruti Date: Fri, 7 Jun 2024 16:55:04 +0000 (-0700) Subject: Maintain compatibility with libxml2.12.5 and later. X-Git-Tag: stable-12.4.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58c7fbfadca63bb61a793ae558f686a42e876505;p=thirdparty%2Fopen-vm-tools.git Maintain compatibility with libxml2.12.5 and later. --- diff --git a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c index 10e5cc83d..8572a7110 100644 --- a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c +++ b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c @@ -432,14 +432,6 @@ SAML_Init(void) */ LIBXML_TEST_VERSION - /* - * Tell libxml to do ID/REF lookups - * Tell libxml to complete attributes with defaults from the DTDs - */ - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); - - /* set up the xml2 error handler */ xmlSetGenericErrorFunc(NULL, XmlErrorHandler); @@ -1524,7 +1516,13 @@ VerifySAMLToken(const gchar *token, strlen(token), NULL, NULL, 0); #else - doc = xmlParseMemory(token, (int)strlen(token)); + /* + * Tell libxml to substitute the entities (XML_PARSE_NOENT). + * Tell libxml to load the external DTD (XML_PARSE_DTDLOAD). + * Tell libxml to add default attributes from the DTD (XML_PARSE_DTDATTR). + */ + doc = xmlReadMemory(token, (int)strlen(token), NULL, NULL, + XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD); #endif if ((NULL == doc) || (xmlDocGetRootElement(doc) == NULL)) { g_warning("Failed to parse document\n");