[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 24 09:07:37 UTC 2018


 sfx2/source/doc/docfile.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 8f575690ef7e8861cba01fada2166ca31424ebc5
Author:     Tor Lillqvist <tml at iki.fi>
AuthorDate: Wed Nov 21 13:54:28 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Sat Nov 24 10:07:16 2018 +0100

    Don't create temp file in save destination folder when sandboxed
    
    In a sandboxed environment we don't want to attempt to create
    temporary files in the same directory where the user has selected an
    output file to be stored. The sandboxed process has permission only to
    create the specifically named output file that the user chose in the
    system file dialog in that directory.
    
    Change-Id: I65274b4c433bd66b436429bea4b287a0505b72c9
    (cherry picked from commit 54c2e3c83ab08ebe6179561e057e5189a842a631)
    Reviewed-on: https://gerrit.libreoffice.org/63918
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 61e92a3e0d5f..144fe50aa64c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -3506,6 +3506,11 @@ OUString GetLogicBase(std::unique_ptr<SfxMedium_Impl> const & pImpl)
 {
     OUString aLogicBase;
 
+// In a sandboxed environment we don't want to attempt to create temporary files in the same
+// directory where the user has selected an output file to be stored. The sandboxed process has
+// permission only to create the specifically named output file in that directory.
+#if !HAVE_FEATURE_MACOSX_SANDBOX
+
     if (comphelper::isFileUrl(pImpl->m_aLogicName) && !pImpl->m_pInStream)
     {
         // Try to create the temp file in the same directory when storing.
@@ -3521,6 +3526,8 @@ OUString GetLogicBase(std::unique_ptr<SfxMedium_Impl> const & pImpl)
         // Embedded objects would mean a special base, ignore that.
         aLogicBase.clear();
 
+#endif // !HAVE_FEATURE_MACOSX_SANDBOX
+
     return aLogicBase;
 }
 }


More information about the Libreoffice-commits mailing list