[Libreoffice-commits] online.git: loolwsd/LOOLSession.cpp

Jan Holesovsky kendy at collabora.com
Thu Nov 5 03:17:46 PST 2015


 loolwsd/LOOLSession.cpp |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit c6743b4d644bce8df95ac1e1f4bb9e0fd28f89db
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Nov 5 12:15:54 2015 +0100

    loolwsd: Remove the potential leftover document before attempting to link.
    
    Otherwise we create a copy, and at the moment, the copy is not copied back out
    of the chroot jail; we should bind that to the .uno:Save callback...

diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 36b6a92..32b4b9f 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -627,6 +627,11 @@ void MasterProcessSession::dispatchChild()
 
         }
 
+        // cleanup potential leftovers from the last time
+        File aToCleanup(aDstFile);
+        if (aToCleanup.exists())
+            aToCleanup.remove();
+
 #ifdef __linux
         Application::instance().logger().information(Util::logPrefix() + "Linking " + aSrcFile.toString() + " to " + aDstFile.toString());
         if (link(aSrcFile.toString().c_str(), aDstFile.toString().c_str()) == -1)


More information about the Libreoffice-commits mailing list