The following commit has been merged in the ubuntu-precise-3.5 branch: commit 01949c20b652c10dba70fdab28fdb9978d17c5f9 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Tue Mar 27 13:42:35 2012 +0200
fdo#43895 lp#905355: Never let users save in /tmp by default diff --git a/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff b/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff new file mode 100644 index 0000000..5016b35 --- /dev/null +++ b/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff @@ -0,0 +1,81 @@ +From dd2fe95cce75f1157bd1c75d286a0047b2e4175e Mon Sep 17 00:00:00 2001 +From: "Andrzej J. R. Hunt" <andr...@hunt.org> +Date: Tue, 27 Mar 2012 10:32:52 +0200 +Subject: [PATCH] fdo#43895 lp#905355: Never let users save in /tmp by default + +--- + sfx2/source/dialog/filedlghelper.cxx | 23 +++++++++++++++++++++++ + sfx2/source/dialog/filedlgimpl.hxx | 2 ++ + 2 files changed, 25 insertions(+), 0 deletions(-) + +diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx +index 3bf4fb5..0018912 100644 +--- a/sfx2/source/dialog/filedlghelper.cxx ++++ b/sfx2/source/dialog/filedlghelper.cxx +@@ -101,6 +101,9 @@ + #include <sfxlocal.hrc> + #include <rtl/oustringostreaminserter.hxx> + #include <rtl/strbuf.hxx> ++#ifdef UNX ++#include <sys/stat.h> ++#endif + + //----------------------------------------------------------------------------- + +@@ -1635,6 +1638,24 @@ void FileDialogHelper_Impl::getRealFilter( String& _rFilter ) const + } + } + ++void FileDialogHelper_Impl::verifyPath() ++{ ++#ifdef UNX ++ struct stat aFileStat; ++ const OString sFullPath = OUStringToOString( maPath.copy(RTL_CONSTASCII_LENGTH("file://")) + maFileName, osl_getThreadTextEncoding() ); ++ stat( sFullPath.getStr(), &aFileStat ); ++ // lp#905355, fdo#43895 ++ // Check that the file has read only permission and is in /tmp -- this is ++ // the case if we have opened the file from the web with firefox only. ++ if ( maPath.reverseCompareToAsciiL("file:///tmp",11) == 0 && ++ ( aFileStat.st_mode & (S_IRWXO + S_IRWXG + S_IRWXU) ) == S_IRUSR ) ++ { ++ maPath = SvtPathOptions().GetWorkPath(); ++ mxFileDlg->setDisplayDirectory( maPath ); ++ } ++#endif ++} ++ + // ------------------------------------------------------------------------ + void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) + { +@@ -1648,6 +1669,7 @@ void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) + try + { + mxFileDlg->setDisplayDirectory( maPath ); ++ verifyPath(); + } + catch( const IllegalArgumentException& ) + { +@@ -1665,6 +1687,7 @@ void FileDialogHelper_Impl::setFileName( const ::rtl::OUString& _rFile ) + try + { + mxFileDlg->setDefaultName( maFileName ); ++ verifyPath(); + } + catch( const IllegalArgumentException& ) + { +diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx +index 4f4e86d..4c3c68b 100644 +--- a/sfx2/source/dialog/filedlgimpl.hxx ++++ b/sfx2/source/dialog/filedlgimpl.hxx +@@ -152,6 +152,8 @@ namespace sfx2 + + void implInitializeFileName( ); + ++ void verifyPath( ); ++ + void implGetAndCacheFiles( const ::com::sun::star::uno::Reference< XInterface >& xPicker , + std::vector<rtl::OUString>& rpURLList, + const SfxFilter* pFilter ); +-- +1.7.9.1 + diff --git a/patches/series b/patches/series index f78bb59..c9dbe0c 100644 --- a/patches/series +++ b/patches/series @@ -37,3 +37,4 @@ pkgconfig-mozilla-plugin.diff ubuntu-quicklists.diff fix-for-kdelibs-enum.diff fdo-40607-osl_syncFile-having-written-and-avoid-doin.diff +fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff -- LibreOffice packaging repository -- To UNSUBSCRIBE, email to debian-openoffice-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1sczq9-0007tl...@vasks.debian.org