diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-11-15 14:12:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-11-15 17:47:04 +0100 |
commit | ac37f40464a6bce346e588b3979bf97809f18f27 (patch) | |
tree | 3f731ed7dc2f04139c78fd890d975e2cc1fc6c14 /xmlsecurity/qa/unit | |
parent | Fix wrong path name (diff) | |
download | core-ac37f40464a6bce346e588b3979bf97809f18f27.tar.gz core-ac37f40464a6bce346e588b3979bf97809f18f27.zip |
Adapt recent CppunitTest_xmlsecurity_signing fix to ASan
f0305ec0a7d199e605511844d9d6af98b66d4bfd "Fix creation/removal of GPG socketdir"
spawns additional gpgconf processes which need the same LD_LIBRARY_PATH fix as
d15f042abd5a1093984a0c8380837145f38c4efc "CppunitTest_xmlsecurity_signing failed
in sanitizer builds"
Change-Id: I1da9e9e459c5a584f092966923f8818f115322dc
Reviewed-on: https://gerrit.libreoffice.org/63420
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmlsecurity/qa/unit')
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 15553c922934..e6054c5f6129 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -196,6 +196,9 @@ void SigningTest::setUp() osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData); #if HAVE_GPGCONF_SOCKETDIR + auto const ldPath = std::getenv("LIBO_LD_PATH"); + m_gpgconfCommandPrefix + = ldPath == nullptr ? OString() : OStringLiteral("LD_LIBRARY_PATH=") + ldPath + " "; OString path; bool ok = aTargetPath.convertToString(&path, osl_getThreadTextEncoding(), RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR @@ -203,9 +206,10 @@ void SigningTest::setUp() // if conversion fails, at least provide a best-effort conversion in the message here, for // context CPPUNIT_ASSERT_MESSAGE(OUStringToOString(aTargetPath, RTL_TEXTENCODING_UTF8).getStr(), ok); - m_gpgconfCommandPrefix = "GNUPGHOME=" + path + " " GPGME_GPGCONF; + m_gpgconfCommandPrefix += "GNUPGHOME=" + path + " " GPGME_GPGCONF; // HAVE_GPGCONF_SOCKETDIR is only defined in configure.ac for Linux for now, so (a) std::system - // behavior will conform to POSIX, and (b) gpgconf --create-socketdir should return zero: + // behavior will conform to POSIX (and the relevant env var to setis named LD_LIBRARY_PATH), and + // (b) gpgconf --create-socketdir should return zero: OString cmd = m_gpgconfCommandPrefix + " --create-socketdir"; int res = std::system(cmd.getStr()); CPPUNIT_ASSERT_EQUAL_MESSAGE(cmd.getStr(), 0, res); |