[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sal/qa
Fridrich Strba
fridrich at kemper.freedesktop.org
Mon May 9 05:55:26 PDT 2011
sal/qa/osl/security/osl_Security.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 241b8ef6e5145c9b4731c37ca62f013c82d06723
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Sun May 8 14:13:51 2011 +0200
Fix osl_Security::getHomeDir test under fakeroot
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 <fridrich.strba at bluewin.ch>
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index e93714b..93fa96a 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);
More information about the Libreoffice-commits
mailing list