summaryrefslogtreecommitdiff
path: root/sfx2/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-08-28 09:05:06 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-28 15:28:09 +0200
commit38afe2976eea427999c39ee3a73e7938ec8d5f7b (patch)
treebf46ea5df9c68da7d47ad16c1bea4512ac2c23d2 /sfx2/qa
parent29591a97d2832c1313d728db51b575de3fe5b672 (diff)
tdf#119050 sfx2 store: don't inherit temp file permissions when overwriting
The too aggressive error handling in commit fb04780cf8523ad4e900ae8b9cecbe7a2697a12a (tdf#116117 sfx2 store: don't inherit temp file permissions when renaming, 2018-03-12) means that if the file is already there, then we don't try to stat() it; even if there is no problem with that. Change-Id: Ie0b9084064834e339bcae3ad7b4a35c54cb9d3c2 Reviewed-on: https://gerrit.libreoffice.org/59684 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sfx2/qa')
-rw-r--r--sfx2/qa/cppunit/test_misc.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 9c21ae95d704..fa3a2c1bca6d 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -146,6 +146,14 @@ void MiscTest::testNoThumbnail()
// umask requested so:
CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_OthRead);
+
+ // Now "save as" again to trigger the "overwrite" case.
+ xStorable->storeToURL(aTempFile.GetURL(), {});
+ CPPUNIT_ASSERT_EQUAL(osl::DirectoryItem::E_None, aItem.getFileStatus(aStatus));
+ // The following check used to fail in the past, result had temp file
+ // permissions.
+ CPPUNIT_ASSERT(aStatus.getAttributes() & osl_File_Attribute_GrpRead);
+
umask(nMask);
#endif