[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sal/osl
Michael Stahl
mstahl at redhat.com
Wed Mar 9 09:56:07 UTC 2016
sal/osl/unx/file_misc.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 26738bfce8156bf7aedeced3ba55e20e9383be7c
Author: Michael Stahl <mstahl at redhat.com>
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 <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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)
More information about the Libreoffice-commits
mailing list