diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-07 18:53:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-03-09 09:55:39 +0000 |
commit | 26738bfce8156bf7aedeced3ba55e20e9383be7c (patch) | |
tree | 71e161b1d04e05aa688f904024848937fcf5ec9f | |
parent | e93270fae07be68a92bdb7d6d964a54412ce983c (diff) |
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@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index c78e7753e0be..394eef915019 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) |