Call freezeContent after move into annex
This change better supports Windows ACL management using annex.freezecontent-command and annex.thawcontent-command and matches the behaviour of adding an unlocked file. By calling freezeContent after the file has moved into the annex, the file's delete permission can be denied. If the file's delete permission is denied before moving into the annex, the file cannot be moved or deleted. If the file's delete permission is not denied after moving into the annex, it will likely inherit a grant for the delete permission which allows it to be deleted irrespective of the permissions of the parent directory.
This commit is contained in:
parent
82e3eb5af3
commit
0db7297f00
1 changed files with 3 additions and 0 deletions
|
@ -346,6 +346,9 @@ moveAnnex key af src = ifM (checkSecureHashes' key)
|
|||
liftIO $ moveFile
|
||||
(fromRawFilePath src)
|
||||
(fromRawFilePath dest)
|
||||
-- On Windows the delete permission must be denied only
|
||||
-- after the content has been moved in the annex.
|
||||
freezeContent dest
|
||||
g <- Annex.gitRepo
|
||||
fs <- map (`fromTopFilePath` g)
|
||||
<$> Database.Keys.getAssociatedFiles key
|
||||
|
|
Loading…
Reference in a new issue