diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-03 21:07:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-04 14:33:37 +0200 |
commit | 72be5ac08aa963bdd42d2e56a62f43e69f728caa (patch) | |
tree | 47bae4c7269b1ff724171bf856a6da3fb9ac5755 /sfx2/qa/cppunit | |
parent | b9757f5cfdb62b24e79eeb4c0ef0c8b98056cecf (diff) |
tdf#119381 sfx2 store: don't break symlink targets
osl::File::move() would not follow symlinks for the target, so don't
move the file in that case.
Change-Id: I907e1ba8db04dad670c884ea0283947f953117da
Reviewed-on: https://gerrit.libreoffice.org/59949
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sfx2/qa/cppunit')
-rw-r--r-- | sfx2/qa/cppunit/test_misc.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx index fa3a2c1bca6d..83c4c8db77f7 100644 --- a/sfx2/qa/cppunit/test_misc.cxx +++ b/sfx2/qa/cppunit/test_misc.cxx @@ -186,6 +186,15 @@ void MiscTest::testHardLinks() // This failed: hard link count was 1, the hard link broke on store. CPPUNIT_ASSERT(buf.st_nlink > 1); + // Test that symlinks are presreved as well. + remove(aNew.getStr()); + symlink(aOld.getStr(), aNew.getStr()); + xStorable->storeToURL(aURL + ".2", {}); + nRet = lstat(aNew.getStr(), &buf); + CPPUNIT_ASSERT_EQUAL(0, nRet); + // This failed, the hello.odt.2 symlink was replaced with a real file. + CPPUNIT_ASSERT(bool(S_ISLNK(buf.st_mode))); + xComponent->dispose(); #endif } |