diff options
-rw-r--r-- | Git/Destroyer.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Git/Destroyer.hs b/Git/Destroyer.hs index 57d8ad5..8827976 100644 --- a/Git/Destroyer.hs +++ b/Git/Destroyer.hs @@ -139,8 +139,12 @@ applyDamage ds r = do moveFile fb fa moveFile tmp fa where - -- A broken .git/config is not recoverable. - skipped f = f `elem` [ "config" ] + -- A broken .git/config is not recoverable. + -- Don't damage hook scripts, to avoid running arbitrary code. ;) + skipped f = or + [ f == "config" + , "hooks" `isPrefixOf` f + ] withSaneMode :: FilePath -> IO () -> IO () withSaneMode f = withModifiedFileMode f (addModes [ownerWriteMode, ownerReadMode]) |