Hi,

See the attached patch, I needed it to build 3.4beta4 under fakeroot
(for some reason I did not have this issue with beta3).

Can someone sign it off and push to -3-4, please?

Thanks.
From f68130520cad8ff76559f6e5bf202cf076297b9d Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmik...@frugalware.org>
Date: Sun, 8 May 2011 14:13:51 +0200
Subject: [PATCH] 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.
---
 sal/qa/osl/security/osl_Security.cxx |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

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);
-- 
1.7.4.4

Attachment: pgpEJZq9uC5Dm.pgp
Description: PGP signature

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to