Kaydet (Commit) ac37f404 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Adapt recent CppunitTest_xmlsecurity_signing fix to ASan

f0305ec0 "Fix creation/removal of GPG socketdir"
spawns additional gpgconf processes which need the same LD_LIBRARY_PATH fix as
d15f042a "CppunitTest_xmlsecurity_signing failed
in sanitizer builds"

Change-Id: I1da9e9e459c5a584f092966923f8818f115322dc
Reviewed-on: https://gerrit.libreoffice.org/63420
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 38d9c708
...@@ -196,6 +196,9 @@ void SigningTest::setUp() ...@@ -196,6 +196,9 @@ void SigningTest::setUp()
osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData); osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData);
#if HAVE_GPGCONF_SOCKETDIR #if HAVE_GPGCONF_SOCKETDIR
auto const ldPath = std::getenv("LIBO_LD_PATH");
m_gpgconfCommandPrefix
= ldPath == nullptr ? OString() : OStringLiteral("LD_LIBRARY_PATH=") + ldPath + " ";
OString path; OString path;
bool ok = aTargetPath.convertToString(&path, osl_getThreadTextEncoding(), bool ok = aTargetPath.convertToString(&path, osl_getThreadTextEncoding(),
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
...@@ -203,9 +206,10 @@ void SigningTest::setUp() ...@@ -203,9 +206,10 @@ void SigningTest::setUp()
// if conversion fails, at least provide a best-effort conversion in the message here, for // if conversion fails, at least provide a best-effort conversion in the message here, for
// context // context
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(aTargetPath, RTL_TEXTENCODING_UTF8).getStr(), ok); 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 // 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"; OString cmd = m_gpgconfCommandPrefix + " --create-socketdir";
int res = std::system(cmd.getStr()); int res = std::system(cmd.getStr());
CPPUNIT_ASSERT_EQUAL_MESSAGE(cmd.getStr(), 0, res); CPPUNIT_ASSERT_EQUAL_MESSAGE(cmd.getStr(), 0, res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment