From a2fb2cfd45452512fb1d3e79b3cc1f4c7cef2e77 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 7 Mar 2016 18:53:55 +0100 Subject: 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 --- sal/osl/unx/file_misc.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sal') diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 7f3356ec4f40..3c0ea7751464 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -803,7 +803,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) -- cgit