summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-18 18:05:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-18 18:13:09 -0400
commit891868cf0185b8a1b81a8a39cd88ce2e00cdc338 (patch)
tree42173433755ea7c36473fc858d46ce48a3c4a126 /Utility
parent72bd1369cd32320bb268b16b97032b1f11b33edc (diff)
Ensure execute bit is set on directories when core.sharedrepsitory is set.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/FileMode.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs
index d76fb5703..1307d3842 100644
--- a/Utility/FileMode.hs
+++ b/Utility/FileMode.hs
@@ -65,12 +65,15 @@ allowWrite :: FilePath -> IO ()
allowWrite f = modifyFileMode f $ addModes [ownerWriteMode]
{- Allows owner and group to read and write to a file. -}
-groupWriteRead :: FilePath -> IO ()
-groupWriteRead f = modifyFileMode f $ addModes
+groupSharedModes :: [FileMode]
+groupSharedModes =
[ ownerWriteMode, groupWriteMode
, ownerReadMode, groupReadMode
]
+groupWriteRead :: FilePath -> IO ()
+groupWriteRead f = modifyFileMode f $ addModes groupSharedModes
+
checkMode :: FileMode -> FileMode -> Bool
checkMode checkfor mode = checkfor `intersectFileModes` mode == checkfor