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
This commit is contained in:
Michael Stahl
2016-03-07 18:53:55 +01:00
parent a95c023142
commit a2fb2cfd45

View File

@@ -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)