avoid using removePathForcibly everywhere, it is unsafe
If the temp directory can somehow contain a hard link, it changes the
mode, which affects all other hard linked files. So, it's too unsafe
to use everywhere in git-annex, since hard links are possible in
multiple ways and it would be very hard to prove that every place that
uses a temp directory cannot possibly put a hard link in it.
Added a call to removeDirectoryForCleanup to test_crypto, which will
fix the problem that commit 17b20a2450
was intending to fix, with a much smaller hammer.
Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
1b02cd4715
commit
642703c7e4
4 changed files with 40 additions and 8 deletions
7
Test.hs
7
Test.hs
|
@ -1794,7 +1794,12 @@ test_crypto = do
|
|||
-- it needs to be able to store the agent socket there,
|
||||
-- which can be problimatic when testing some filesystems.
|
||||
absgpgtmp <- fromRawFilePath <$> absPath (toRawFilePath gpgtmp)
|
||||
testscheme' scheme absgpgtmp
|
||||
res <- testscheme' scheme absgpgtmp
|
||||
-- gpg may still be running and would prevent
|
||||
-- removeDirectoryRecursive from succeeding, so
|
||||
-- force removal of the temp directory.
|
||||
liftIO $ removeDirectoryForCleanup gpgtmp
|
||||
return res
|
||||
testscheme' scheme absgpgtmp = intmpclonerepo $ do
|
||||
-- Since gpg uses a unix socket, which is limited to a
|
||||
-- short path, use whichever is shorter of absolute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue