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
|
@ -69,11 +69,4 @@ removeTmpDir tmpdir = liftIO $ whenM (doesDirectoryExist tmpdir) $ do
|
|||
go tmpdir
|
||||
#endif
|
||||
where
|
||||
-- Use removePathForcibly when available, to avoid crashing
|
||||
-- if some other process is removing files in the directory at the
|
||||
-- same time.
|
||||
#if MIN_VERSION_directory(1,2,7)
|
||||
go = removePathForcibly
|
||||
#else
|
||||
go = removeDirectoryRecursive
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue