diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-15 14:52:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-15 14:52:03 -0400 |
commit | 454c990ce49af450d3177f2ea9c6132681959078 (patch) | |
tree | 9c11d10ccac85d646f7c85a1e51b71efc0a7c28a /Command/Fsck.hs | |
parent | a4ea1393cef234518bfa8dcaeb522259a485b414 (diff) |
Direct mode .git/annex/objects directories are no longer left writable
Because that allowed writing to symlinks of files that are not present,
which followed the link and put bad content in an object location.
fsck: Fix up .git/annex/object directory permissions.
This commit was sponsored by an anonymous bitcoin donor.
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 3b89c550c..a8e52af98 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -218,9 +218,10 @@ verifyLocationLog key desc = do {- Since we're checking that a key's file is present, throw - in a permission fixup here too. -} - when (present && not direct) $ do - file <- calcRepo $ gitAnnexLocation key + file <- calcRepo $ gitAnnexLocation key + when (present && not direct) $ freezeContent file + whenM (liftIO $ doesDirectoryExist $ parentDir file) $ freezeContentDir file {- In direct mode, modified files will show up as not present, |