summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-12-04 17:48:47 +0100
committerAndras Timar <andras.timar@collabora.com>2019-01-17 13:45:58 +0100
commit284265e32e7f04938a04f159a7d25377193d98c1 (patch)
tree975479044fc786232fae31bcfa6b48017669831c /xmlsecurity
parentb7d2114afe3991945936270f0d4f5e044b69bfc2 (diff)
tdf#118373 xmlsecurity: avoid stderr output on libxmlsec version check
Make sure that our normal SAL_WARN() reporting is registered during the xmlSecCheckVersionExt() invocation, just like it's registered during other libxmlsec API calls. (cherry picked from commit 099ab643f60efc5be6f151bff89651efd2da1fc9) Change-Id: Ia19368b55dbae47974f48954f86b50e36d1462ff Reviewed-on: https://gerrit.libreoffice.org/64626 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 975a1934994ab1e7e5f2ac890f00159c73546a61)
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/xmlstreamio.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index 910944e11611..6edd946da4fa 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -22,8 +22,10 @@
* Implementation of the I/O interfaces based on stream and URI binding
*/
#include <xmlsec/xmlstreamio.hxx>
+#include <xmlsec/errorcallback.hxx>
#include <rtl/ustring.hxx>
#include <rtl/uri.hxx>
+#include <comphelper/scopeguard.hxx>
#include <libxml/uri.h>
#include <xmlsec-wrapper.h>
@@ -157,6 +159,10 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks()
//Notes: all none default callbacks will lose.
xmlSecIOCleanupCallbacks() ;
+ // Make sure that errors are reported via SAL_WARN().
+ setErrorRecorder();
+ comphelper::ScopeGuard g([] { clearErrorRecorder(); });
+
// Newer xmlsec wants the callback order in the opposite direction.
if (xmlSecCheckVersionExt(1, 2, 26, xmlSecCheckVersionABICompatible))
{