diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-06 17:30:57 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-06 17:30:57 -0400 |
commit | b5e25fc0b619f21fb8ebe202a07db5eacd5d4df7 (patch) | |
tree | 8af64ca0c858ffb984dc4e9e4b866ef1e9a98449 /Annex/Content.hs | |
parent | 8ece8d39e8fff3ecef1815a7c0d7a37aa4bcb46f (diff) |
git-annex-shell: Ensure that received files can be read. Files transferred from some Android devices may have very broken permissions as received.
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r-- | Annex/Content.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 6f2c9690e..ad04bdba1 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -470,9 +470,8 @@ preseedTmp key file = go =<< inAnnex key liftIO $ copyFileExternal s file ) -{- Blocks writing to an annexed file. The file is made unwritable - - to avoid accidental edits. core.sharedRepository may change - - who can read it. -} +{- Blocks writing to an annexed file, and modifies file permissions to + - allow reading it, per core.sharedRepository setting. -} freezeContent :: FilePath -> Annex () freezeContent file = unlessM crippledFileSystem $ liftIO . go =<< fromRepo getSharedRepository @@ -483,7 +482,9 @@ freezeContent file = unlessM crippledFileSystem $ go AllShared = modifyFileMode file $ removeModes writeModes . addModes readModes - go _ = preventWrite file + go _ = modifyFileMode file $ + removeModes writeModes . + addModes [ownerReadMode] {- Allows writing to an annexed file that freezeContent was called on - before. -} |