From 454c990ce49af450d3177f2ea9c6132681959078 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Nov 2013 14:52:03 -0400 Subject: 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. --- Command/Fsck.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Command/Fsck.hs') 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, -- cgit v1.2.3