79566: msxml3/sax: Accept disabling of external entities loading

buildbot at kegel.com buildbot at kegel.com
Tue Oct 4 18:02:13 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

For more info about this message, see http://wiki.winehq.org/BuildBot

The Buildbot has detected a failed build on builder runtests-ati while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-ati/builds/93 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed git

Errors:
error: patch failed: dlls/msxml3/saxreader.c:49
error: dlls/msxml3/saxreader.c: patch does not apply

-------------- next part --------------
From: Nikolay Sivov <nsivov at codeweavers.com>
Subject: msxml3/sax: Accept disabling of external entities loading
Message-Id: <4E8B7B35.3060509 at codeweavers.com>
Date: Tue, 04 Oct 2011 16:31:33 -0500

Accepting this particular case seems harmless cause libxml2 has external 
entities loader disabled by default.

P.S. Excel asks for this on xslx open sequence.

From 7685c782397c9f023a126ee79f1d7392c1eb66f6 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue, 4 Oct 2011 16:27:39 -0500
Subject: [PATCH 5/5] Accept disabling of external entities loading

---
 dlls/msxml3/saxreader.c |   48 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index fca390a..0460533 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -49,6 +49,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 
 #ifdef HAVE_LIBXML2
 
+enum ReaderFeatures
+{
+    ExhaustiveErrors             = 1 << 1,
+    ExternalGeneralEntities      = 1 << 2,
+    ExternalParameterEntities    = 1 << 3,
+    ForcedResync                 = 1 << 4,
+    NamespacePrefixes            = 1 << 5,
+    Namespace                    = 1 << 6,
+    ParameterEntities            = 1 << 7,
+    PreserveSystemIndentifiers   = 1 << 8,
+    ProhibitDTD                  = 1 << 9,
+    SchemaValidation             = 1 << 10,
+    ServerHttpRequest            = 1 << 11,
+    SuppressValidationfatalError = 1 << 12,
+    UseInlineSchema              = 1 << 13,
+    UseSchemaLocation            = 1 << 14
+};
+
 struct bstrpool
 {
     BSTR *pool;
@@ -72,6 +90,7 @@ typedef struct _saxreader
     xmlSAXHandler sax;
     BOOL isParsing;
     struct bstrpool pool;
+    enum ReaderFeatures features;
 } saxreader;
 
 typedef struct _saxlocator
@@ -180,6 +199,23 @@ static const WCHAR PropertyXMLDeclVersionW[] = {
     'x','m','l','d','e','c','l','-','v','e','r','s','i','o','n',0
 };
 
+/* feature names */
+static const WCHAR FeatureExternalGeneralEntitiesW[] = {
+    'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/',
+    'f','e','a','t','u','r','e','s','/','e','x','t','e','r','n','a','l','-','g','e','n','e','r','a','l',
+    '-','e','n','t','i','t','i','e','s',0
+};
+
+static inline HRESULT set_feature_value(saxreader *reader, enum ReaderFeatures feature, VARIANT_BOOL value)
+{
+    if (value == VARIANT_TRUE)
+        reader->features |=  feature;
+    else
+        reader->features &= ~feature;
+
+    return S_OK;
+}
+
 static inline BOOL has_content_handler(const saxlocator *locator)
 {
     return  (locator->vbInterface && locator->saxreader->vbcontentHandler) ||
@@ -2568,12 +2604,17 @@ static HRESULT WINAPI saxxmlreader_getFeature(
 
 static HRESULT WINAPI saxxmlreader_putFeature(
     IVBSAXXMLReader* iface,
-    const WCHAR *pFeature,
-    VARIANT_BOOL vfValue)
+    const WCHAR *feature,
+    VARIANT_BOOL value)
 {
     saxreader *This = impl_from_IVBSAXXMLReader( iface );
 
-    FIXME("(%p)->(%s %x) stub\n", This, debugstr_w(pFeature), vfValue);
+    TRACE("(%p)->(%s %x)\n", This, debugstr_w(feature), value);
+
+    if (!strcmpW(FeatureExternalGeneralEntitiesW, feature) && value == VARIANT_FALSE)
+        return set_feature_value(This, ExternalGeneralEntities, value);
+
+    FIXME("(%p)->(%s %x) stub\n", This, debugstr_w(feature), value);
     return E_NOTIMPL;
 }
 
@@ -2964,6 +3005,7 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj)
     reader->pool.pool = NULL;
     reader->pool.index = 0;
     reader->pool.len = 0;
+    reader->features = 0;
 
     memset(&reader->sax, 0, sizeof(xmlSAXHandler));
     reader->sax.initialized = XML_SAX2_MAGIC;
-- 
1.7.1



More information about the wine-tests-results mailing list