From aba11ba22d16a2666f970cd2c3da9b51fd8ed679 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Wed, 27 Apr 2011 21:06:28 +0200 Subject: sal-disable-backtrace.diff: disable backtrace with DISABLE_SAL_BACKTRACE allow to disable backtrace when defined the environment variable DISABLE_SAL_BACKTRACE --- sal/osl/unx/diagnose.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sal') diff --git a/sal/osl/unx/diagnose.c b/sal/osl/unx/diagnose.c index 30d15ad07..041a5e66e 100644 --- a/sal/osl/unx/diagnose.c +++ b/sal/osl/unx/diagnose.c @@ -255,8 +255,9 @@ sal_Bool SAL_CALL osl_assertFailedLine ( /* output message buffer */ OSL_DIAGNOSE_OUTPUTMESSAGE(f, szMessage); - /* output backtrace */ - osl_diagnose_backtrace_Impl(f); + /* if SAL backtrace for assertions is disabled, skip here */ + if ( !getenv("DISABLE_SAL_BACKTRACE") ) + osl_diagnose_backtrace_Impl(f); /* release lock and leave */ pthread_mutex_unlock(&g_mutex); -- cgit v1.2.3 From 241b8ef6e5145c9b4731c37ca62f013c82d06723 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 8 May 2011 14:13:51 +0200 Subject: Fix osl_Security::getHomeDir test under fakeroot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fakeroot uses LD_PRELOAD to let getuid() return 0, so getpwuid() will not return the correct home directory. If we are under fakeroot, the HOME environment variable can be used to do so. Signed-off-by: Fridrich Štrba --- sal/qa/osl/security/osl_Security.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sal') diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx index e93714b92..93fa96ab2 100644 --- a/sal/qa/osl/security/osl_Security.cxx +++ b/sal/qa/osl/security/osl_Security.cxx @@ -393,8 +393,11 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *, strUserName = ::rtl::OUString::createFromAscii( pw->pw_name ); /// get home directory; + char *pw_dir = pw->pw_dir; + if( getenv( "FAKEROOTKEY" ) ) + pw_dir = getenv("HOME"); CPPUNIT_ASSERT_MESSAGE( "#Convert from system path to URL failed.", - ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw->pw_dir ), strHomeDirectory ) ); + ::osl::File::E_None == ::osl::File::getFileURLFromSystemPath( ::rtl::OUString::createFromAscii( pw_dir ), strHomeDirectory ) ); /// get config directory; strConfigDirectory = strHomeDirectory.copy(0); -- cgit v1.2.3