sal/osl/unx/file_misc.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 26738bfce8156bf7aedeced3ba55e20e9383be7c
Author: Michael Stahl <[email protected]>
Date:   Mon Mar 7 18:53:55 2016 +0100

    sal: UNX: in oslDoCopy, rename into destination directory ...
    
    ... not into the source one as that will likely fail with EXDEV if
    source and target are on different mounts => osl_File_E_EXIST.
    
    This broke the xmlsecurity test SigningTest::testOOXMLAppend().
    
    Change-Id: I07ada1d5564fd72a059d588e127a5906a499aca4
    (cherry picked from commit a2fb2cfd45452512fb1d3e79b3cc1f4c7cef2e77)
    Reviewed-on: https://gerrit.libreoffice.org/23014
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index c78e775..394eef9 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -802,7 +802,8 @@ static oslFileError oslDoCopy(const sal_Char* 
pszSourceFileName, const sal_Char*
     if ( DestFileExists )
     {
         //TODO: better pick a temp file name instead of adding .osl-tmp:
-        tmpDestFile = rtl::OString(pszSourceFileName) + ".osl-tmp";
+        // use the destination file to avoid EXDEV /* Cross-device link */
+        tmpDestFile = rtl::OString(pszDestFileName) + ".osl-tmp";
         if (rename(pszDestFileName, tmpDestFile.getStr()) != 0)
         {
             if (errno == ENOENT)
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to