diff -Nru libreoffice-3.5.1/debian/changelog libreoffice-3.5.1/debian/changelog --- libreoffice-3.5.1/debian/changelog 2012-03-18 20:28:47.000000000 +0000 +++ libreoffice-3.5.1/debian/changelog 2012-03-28 15:28:49.000000000 +0000 @@ -1,3 +1,13 @@ +libreoffice (1:3.5.1-1ubuntu2) precise-proposed; urgency=low + + * call fsync on write (LP: #817326) + * add a few conflicts for defusing the old -common dpkg-trigger + around interfering (LP: #916291) + * its com.sun.star.sdb.RowSet, not sdbc neither sbd + * never let users save in /tmp by default (LP: #905355) + + -- Bjoern Michaelsen Tue, 27 Mar 2012 17:11:14 +0200 + libreoffice (1:3.5.1-1ubuntu1) precise; urgency=low * new upstream release diff -Nru libreoffice-3.5.1/debian/control libreoffice-3.5.1/debian/control --- libreoffice-3.5.1/debian/control 2012-03-18 20:32:29.000000000 +0000 +++ libreoffice-3.5.1/debian/control 2012-03-28 15:33:15.000000000 +0000 @@ -108,7 +108,7 @@ Depends: libreoffice-style-default | libreoffice-style, ${misc:Depends}, ure Suggests: libreoffice-style-hicontrast, libreoffice-style-tango, libreoffice-style-crystal, libreoffice-style-human, libreoffice-style-oxygen Recommends: xfonts-mathml, ${textcat-data-recommends} -Conflicts: libtextcat-data (<< 2.2-8), broffice, openoffice.org-common (<< 1:3.3.0~) +Conflicts: libtextcat-data (<< 2.2-8), broffice, openoffice.org-common (<< 1:3.3.0~), libreoffice-common (<< 1:3.5.0) Provides: libreoffice-l10n-en-us Breaks: libreoffice-style-crystal (<< 1:${oover}~), libreoffice-style-oxygen (<< 1:${oover}~), @@ -373,8 +373,8 @@ Section: python Architecture: alpha amd64 armel armhf hppa i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sparc kfreebsd-amd64 kfreebsd-i386 Enhances: libreoffice -Depends: libreoffice-core (= ${binary:Version}), ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Conflicts: python3-uno +Depends: libreofficeu-core (= ${binary:Version}), ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} +Conflicts: python3-uno, libreoffice-common (<< 1:3.5.0) Description: Python-UNO bridge The Python-UNO bridge allows use of the standard LibreOffice API with the Python scripting language. It additionally allows @@ -389,7 +389,7 @@ Architecture: alpha amd64 armel armhf hppa i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sparc kfreebsd-amd64 kfreebsd-i386 Enhances: libreoffice Depends: libreoffice-core (= ${binary:Version}), ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} -Conflicts: python-uno +Conflicts: python-uno, libreoffice-common (<< 1:3.5.0) Description: Python-UNO bridge The Python-UNO bridge allows use of the standard LibreOffice API with the Python scripting language. It additionally allows diff -Nru libreoffice-3.5.1/debian/control.in libreoffice-3.5.1/debian/control.in --- libreoffice-3.5.1/debian/control.in 2012-03-18 20:28:47.000000000 +0000 +++ libreoffice-3.5.1/debian/control.in 2012-03-28 15:28:49.000000000 +0000 @@ -210,7 +210,8 @@ ${textcat-data-recommends} Conflicts: libtextcat-data (<< 2.2-8), broffice, - openoffice.org-common (<< 1:3.3.0~) + openoffice.org-common (<< 1:3.3.0~), + libreoffice-common (<< 1:3.5.0) Provides: libreoffice-l10n-en-us Breaks: libreofficeVER-style-crystal (<< 1:${oover}~), libreofficeVER-style-oxygen (<< 1:${oover}~), @@ -514,11 +515,11 @@ Section: python Architecture: %OOO_ARCHS% Enhances: libreofficeVER -Depends: libreofficeVER-core (= ${binary:Version}), +Depends: libreofficeu-core (= ${binary:Version}), ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Conflicts: python3-uno +Conflicts: python3-uno, libreoffice-common (<< 1:3.5.0) Description: Python-UNO bridge The Python-UNO bridge allows use of the standard LibreOffice API with the Python scripting language. It additionally allows @@ -536,7 +537,7 @@ ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} -Conflicts: python-uno +Conflicts: python-uno, libreoffice-common (<< 1:3.5.0) Description: Python-UNO bridge The Python-UNO bridge allows use of the standard LibreOffice API with the Python scripting language. It additionally allows diff -Nru libreoffice-3.5.1/debian/patches/bibliography-no-crash-if-no-base.diff libreoffice-3.5.1/debian/patches/bibliography-no-crash-if-no-base.diff --- libreoffice-3.5.1/debian/patches/bibliography-no-crash-if-no-base.diff 2012-03-18 20:28:47.000000000 +0000 +++ libreoffice-3.5.1/debian/patches/bibliography-no-crash-if-no-base.diff 2012-03-28 15:28:49.000000000 +0000 @@ -36,7 +36,7 @@ + static bool lcl_isBaseAvailable() + { + Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); -+ Reference< XAggregation > xAggregate = Reference< XAggregation >( xMgr->createInstance(C2U("com.sun.star.sdbc.RowSet")), UNO_QUERY); ++ Reference< XAggregation > xAggregate = Reference< XAggregation >( xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); + return xAggregate.is(); + } +} diff -Nru libreoffice-3.5.1/debian/patches/fdo-40607-osl_syncFile-having-written-and-avoid-doin.diff libreoffice-3.5.1/debian/patches/fdo-40607-osl_syncFile-having-written-and-avoid-doin.diff --- libreoffice-3.5.1/debian/patches/fdo-40607-osl_syncFile-having-written-and-avoid-doin.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-3.5.1/debian/patches/fdo-40607-osl_syncFile-having-written-and-avoid-doin.diff 2012-03-28 15:28:49.000000000 +0000 @@ -0,0 +1,173 @@ +From c6e22c0fc0cc4ce1508f8401c4b0c14fc89df942 Mon Sep 17 00:00:00 2001 +From: Michael Meeks +Date: Mon, 19 Mar 2012 16:31:36 +0100 +Subject: [PATCH] fdo#40607 - osl_syncFile having written, and avoid doing + that on start + +Combinded cherry-pick of master d3192948fe968fc4d6a8ec0e6fda232f265b3c4c +plus subsequent fixes bee742eb7a0d5dfe23e61d9ee49a29286de90256 "Fix sense +of r/o detection code, and clean up" and +61eeb689d7605a23c3e71c652b57ee65cf5b28dc "fix smoketest - need to check +read-only-ness of non-existent paths." + +Signed-off-by: Stephan Bergmann +--- + desktop/source/deployment/manager/dp_manager.cxx | 84 +++++++++++---------- + ucb/source/ucp/file/shell.cxx | 4 + + 2 files changed, 48 insertions(+), 40 deletions(-) + +diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx +index 508d6bb..19117ab 100644 +--- a/desktop/source/deployment/manager/dp_manager.cxx ++++ b/desktop/source/deployment/manager/dp_manager.cxx +@@ -32,6 +32,7 @@ + #include "dp_platform.hxx" + #include "dp_manager.h" + #include "dp_identifier.hxx" ++#include "rtl/oustringostreaminserter.hxx" + #include "rtl/ustrbuf.hxx" + #include "rtl/string.hxx" + #include "rtl/uri.hxx" +@@ -312,6 +313,42 @@ void PackageManagerImpl::initRegistryBackends() + m_xComponentContext ) ); + } + ++// this overcomes previous rumours that the sal API is misleading ++// as to whether a directory is truly read-only or not ++static bool isMacroURLReadOnly( const OUString &rMacro ) ++{ ++ rtl::OUString aDirURL( rMacro ); ++ ::rtl::Bootstrap::expandMacros( aDirURL ); ++ ++ ::osl::FileBase::RC aErr = ::osl::Directory::create( aDirURL ); ++ if ( aErr == ::osl::FileBase::E_None ) ++ return false; // it will be writeable ++ if ( aErr != ::osl::FileBase::E_EXIST ) ++ return true; // some serious problem creating it ++ ++ bool bError; ++ sal_uInt64 nWritten = 0; ++ rtl::OUString aFileURL( ++ aDirURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/stamp.sys")) ); ++ ::osl::File aFile( aFileURL ); ++ ++ bError = aFile.open( osl_File_OpenFlag_Read | ++ osl_File_OpenFlag_Write | ++ osl_File_OpenFlag_Create ) != ::osl::FileBase::E_None; ++ if (!bError) ++ bError = aFile.write( "1", 1, nWritten ) != ::osl::FileBase::E_None; ++ if (aFile.close() != ::osl::FileBase::E_None) ++ bError = true; ++ if (osl::File::remove( aFileURL ) != ::osl::FileBase::E_None) ++ bError = true; ++ ++ SAL_INFO( ++ "desktop.deployment", ++ "local url '" << rMacro << "' -> '" << aFileURL << "' " ++ << (bError ? "is" : "is not") << " readonly\n"); ++ return bError; ++} ++ + //______________________________________________________________________________ + Reference PackageManagerImpl::create( + Reference const & xComponentContext, +@@ -321,7 +358,7 @@ Reference PackageManagerImpl::create( + xComponentContext, context ); + Reference xPackageManager( that ); + +- OUString packages, logFile, stampURL; ++ OUString packages, logFile, stamp; + if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("user") )) { + that->m_activePackages = OUSTR( + "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages"); +@@ -342,8 +379,7 @@ Reference PackageManagerImpl::create( + //using virtualization it appears that he/she can. Then a shared extension can + //be installed but is only visible for the user (because the extension is in + //the virtual store). +- stampURL = OUSTR( +- "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/stamp.sys"); ++ stamp = OUSTR("$UNO_USER_PACKAGES_CACHE"); + } + else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") )) { + that->m_activePackages = OUSTR( +@@ -354,8 +390,7 @@ Reference PackageManagerImpl::create( + "vnd.sun.star.expand:$SHARED_EXTENSIONS_USER/registry"); + logFile = OUSTR( + "vnd.sun.star.expand:$SHARED_EXTENSIONS_USER/log.txt"); +- stampURL = OUSTR( +- "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/stamp.sys"); ++ stamp = OUSTR("$UNO_SHARED_PACKAGES_CACHE"); + } + else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled") )) { + that->m_activePackages = OUSTR( +@@ -394,8 +429,7 @@ Reference PackageManagerImpl::create( + "vnd.sun.star.expand:$TMP_EXTENSIONS"); + that->m_registryCache = OUSTR( + "vnd.sun.star.expand:$TMP_EXTENSIONS/registry"); +- stampURL = OUSTR( +- "vnd.sun.star.expand:$TMP_EXTENSIONS/stamp.sys"); ++ stamp = OUSTR("$TMP_EXTENSIONS"); + } + else if (! context.matchAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") )) { +@@ -407,39 +441,9 @@ Reference PackageManagerImpl::create( + Reference xCmdEnv; + + try { +- //There is no stampURL for the bundled folder +- if (stampURL.getLength() > 0) +- { +-#define CURRENT_STAMP "1" +- try { +- //The osl file API does not allow to find out if one can write +- //into a folder. Therefore we try to write a file. Then we delete +- //it, so that it does not hinder uninstallation of OOo +- // probe writing: +- ::ucbhelper::Content ucbStamp( stampURL, xCmdEnv ); +- ::rtl::OString stamp( +- RTL_CONSTASCII_STRINGPARAM(CURRENT_STAMP) ); +- Reference xData( +- ::xmlscript::createInputStream( +- ::rtl::ByteSequence( +- reinterpret_cast(stamp.getStr()), +- stamp.getLength() ) ) ); +- ucbStamp.writeStream( xData, true /* replace existing */ ); +- that->m_readOnly = false; +- erase_path( stampURL, xCmdEnv ); +- } +- catch (const RuntimeException &) { +- try { +- erase_path( stampURL, xCmdEnv ); +- } catch (...) +- { +- } +- throw; +- } +- catch (const Exception &) { +- that->m_readOnly = true; +- } +- } ++ // There is no stamp for the bundled folder: ++ if (!stamp.isEmpty()) ++ that->m_readOnly = isMacroURLReadOnly( stamp ); + + if (!that->m_readOnly && logFile.getLength() > 0) + { +diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx +index fcc238b..1cd1505 100644 +--- a/ucb/source/ucp/file/shell.cxx ++++ b/ucb/source/ucp/file/shell.cxx +@@ -1913,6 +1913,10 @@ shell::write( sal_Int32 CommandId, + } + } while( nReadBytes == nRequestedBytes ); + ++ aFile.sync(); // fsync / flush it to disk. ++ OSL_TRACE( "fsync'd file '%s'\n", ++ rtl::OUStringToOString( aUnqPath, RTL_TEXTENCODING_UTF8 ).getStr() ); ++ + err = aFile.close(); + if( err != osl::FileBase::E_None ) + { +-- +1.7.9.1 + diff -Nru libreoffice-3.5.1/debian/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff libreoffice-3.5.1/debian/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff --- libreoffice-3.5.1/debian/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-3.5.1/debian/patches/fdo-43895-lp-905355-Never-let-users-save-in-tmp-by-d.diff 2012-03-28 15:28:49.000000000 +0000 @@ -0,0 +1,83 @@ +From c519ff47d25c273fda15626b56e04bd147cf29b4 Mon Sep 17 00:00:00 2001 +From: "Andrzej J. R. Hunt" +Date: Tue, 27 Mar 2012 10:32:52 +0200 +Subject: [PATCH] fdo#43895 lp#905355: Never let users save in /tmp by default + (cherry picked from commit + dd2fe95cce75f1157bd1c75d286a0047b2e4175e) + +--- + 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 141b389..79c1e4e 100644 +--- a/sfx2/source/dialog/filedlghelper.cxx ++++ b/sfx2/source/dialog/filedlghelper.cxx +@@ -100,6 +100,9 @@ + #include + #include + #include ++#ifdef UNX ++#include ++#endif + + //----------------------------------------------------------------------------- + +@@ -1648,6 +1651,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 ) + { +@@ -1661,6 +1682,7 @@ void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) + try + { + mxFileDlg->setDisplayDirectory( maPath ); ++ verifyPath(); + } + catch( const IllegalArgumentException& ) + { +@@ -1678,6 +1700,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 6770bb7..3433883 100644 +--- a/sfx2/source/dialog/filedlgimpl.hxx ++++ b/sfx2/source/dialog/filedlgimpl.hxx +@@ -155,6 +155,8 @@ namespace sfx2 + + void implInitializeFileName( ); + ++ void verifyPath( ); ++ + void implGetAndCacheFiles( const ::com::sun::star::uno::Reference< XInterface >& xPicker , + SvStringsDtor*& rpURLList, + const SfxFilter* pFilter ); +-- +1.7.9.1 + diff -Nru libreoffice-3.5.1/debian/patches/series libreoffice-3.5.1/debian/patches/series --- libreoffice-3.5.1/debian/patches/series 2012-03-18 20:28:47.000000000 +0000 +++ libreoffice-3.5.1/debian/patches/series 2012-03-28 15:28:49.000000000 +0000 @@ -36,3 +36,5 @@ 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