[Libreoffice-commits] core.git: xmlsecurity/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jun 8 06:12:10 UTC 2018


 xmlsecurity/source/xmlsec/xmlstreamio.cxx |   69 +++++++++++++++---------------
 1 file changed, 36 insertions(+), 33 deletions(-)

New commits:
commit bc4e43dd926bbe6f5315b5c372770ac8c7222177
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 7 21:24:09 2018 +0200

    xmlsecurity: check for the libxmlsec version runtime, not build-time
    
    For the general benefit of --with-system-xmlsec usage scenarios (where
    LO may be built against an old version of xmlsec and run against a new
    one).
    
    Change-Id: I4ae582771dbc8eec149a706cfa5ccc0ec0859704
    Reviewed-on: https://gerrit.libreoffice.org/55446
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index 83dd83e66a25..910944e11611 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -158,41 +158,44 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks()
         xmlSecIOCleanupCallbacks() ;
 
         // Newer xmlsec wants the callback order in the opposite direction.
-#if XMLSEC_VERSION_MAJOR > 1 || (XMLSEC_VERSION_MAJOR == 1 && XMLSEC_VERSION_MINOR > 2) || (XMLSEC_VERSION_MAJOR == 1 && XMLSEC_VERSION_MINOR == 2 && XMLSEC_VERSION_SUBMINOR >= 26)
-        //Register the default callbacks.
-        //Notes: the error will cause xmlsec working problems.
-        int cbs = xmlSecIORegisterDefaultCallbacks() ;
-        if( cbs < 0 ) {
-            return -1 ;
-        }
-
-        //Register my classbacks.
-        cbs = xmlSecIORegisterCallbacks(
-                    xmlStreamMatch,
-                    xmlStreamOpen,
-                    xmlStreamRead,
-                    xmlStreamClose ) ;
-        if( cbs < 0 ) {
-            return -1 ;
-        }
-#else
-        //Register my classbacks.
-        int cbs = xmlSecIORegisterCallbacks(
-                    xmlStreamMatch,
-                    xmlStreamOpen,
-                    xmlStreamRead,
-                    xmlStreamClose ) ;
-        if( cbs < 0 ) {
-            return -1 ;
+        if (xmlSecCheckVersionExt(1, 2, 26, xmlSecCheckVersionABICompatible))
+        {
+            //Register the default callbacks.
+            //Notes: the error will cause xmlsec working problems.
+            int cbs = xmlSecIORegisterDefaultCallbacks() ;
+            if( cbs < 0 ) {
+                return -1 ;
+            }
+
+            //Register my classbacks.
+            cbs = xmlSecIORegisterCallbacks(
+                        xmlStreamMatch,
+                        xmlStreamOpen,
+                        xmlStreamRead,
+                        xmlStreamClose ) ;
+            if( cbs < 0 ) {
+                return -1 ;
+            }
         }
-
-        //Register the default callbacks.
-        //Notes: the error will cause xmlsec working problems.
-        cbs = xmlSecIORegisterDefaultCallbacks() ;
-        if( cbs < 0 ) {
-            return -1 ;
+        else
+        {
+            //Register my classbacks.
+            int cbs = xmlSecIORegisterCallbacks(
+                        xmlStreamMatch,
+                        xmlStreamOpen,
+                        xmlStreamRead,
+                        xmlStreamClose ) ;
+            if( cbs < 0 ) {
+                return -1 ;
+            }
+
+            //Register the default callbacks.
+            //Notes: the error will cause xmlsec working problems.
+            cbs = xmlSecIORegisterDefaultCallbacks() ;
+            if( cbs < 0 ) {
+                return -1 ;
+            }
         }
-#endif
 
         enableXmlStreamIO |= XMLSTREAMIO_INITIALIZED ;
     }


More information about the Libreoffice-commits mailing list