[Libreoffice-commits] core.git: 2 commits - sal/osl xmlsecurity/qa
Michael Stahl
mstahl at redhat.com
Mon Mar 7 17:59:23 UTC 2016
sal/osl/unx/file_misc.cxx | 3 ++-
xmlsecurity/qa/unit/signing/signing.cxx | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit a2fb2cfd45452512fb1d3e79b3cc1f4c7cef2e77
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
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 7f3356e..3c0ea77 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)
commit a95c02314202b41bfac5555b68f97018adca31d4
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Mar 7 18:53:17 2016 +0100
xmlsecurity: check that osl::File::copy actually succeeds
... which it doesn't, currently.
Change-Id: I0280a11006afb08b95ff643e8b999b4e5a733d2d
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 1894cb9..466c867 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -208,7 +208,8 @@ void SigningTest::testOOXMLAppend()
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
OUString aURL = aTempFile.GetURL();
- osl::File::copy(getURLFromSrc(DATA_DIRECTORY) + "partial.docx", aURL);
+ CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
+ osl::File::copy(getURLFromSrc(DATA_DIRECTORY) + "partial.docx", aURL));
// Load the test document as a storage and read its single signature.
DocumentSignatureManager aManager(mxComponentContext, SignatureModeDocumentContent);
CPPUNIT_ASSERT(aManager.maSignatureHelper.Init());
@@ -263,7 +264,8 @@ void SigningTest::testOOXMLRemoveAll()
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
OUString aURL = aTempFile.GetURL();
- osl::File::copy(getURLFromSrc(DATA_DIRECTORY) + "partial.docx", aURL);
+ CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
+ osl::File::copy(getURLFromSrc(DATA_DIRECTORY) + "partial.docx", aURL));
// Load the test document as a storage and read its single signature.
DocumentSignatureManager aManager(mxComponentContext, SignatureModeDocumentContent);
CPPUNIT_ASSERT(aManager.maSignatureHelper.Init());
More information about the Libreoffice-commits
mailing list