[Libreoffice-commits] .: sal/qa

Fridrich Strba fridrich at kemper.freedesktop.org
Mon May 9 05:55:43 PDT 2011


 sal/qa/osl/security/osl_Security.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d6c7f7f828905301cefb1cb747b5b93daf337015
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.

diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index 795cf7f..edd9669 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