Skip to content

Commit

Permalink
More comments on checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Dec 19, 2023
1 parent ab25f73 commit 928c63c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Codec/Archive/Tar/Check/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ import qualified System.FilePath.Posix as FilePath.Posix
-- link target. A failure in any entry terminates the sequence of entries with
-- an error.
--
-- Whenever possible, consider fusing 'checkSecurity' with packing / unpacking by using
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
-- with 'checkEntrySecurity'.
-- Not only it is faster, but also alleviates issues with lazy I/O
-- such as exhaustion of file handlers.
checkSecurity
:: Entries e
-> GenEntries FilePath FilePath (Either (Either e DecodeLongNamesError) FileNameError)
Expand Down Expand Up @@ -154,6 +159,11 @@ showFileNameError mb_plat err = case err of
-- Note: This check must be used in conjunction with 'checkSecurity'
-- (or 'checkPortability').
--
-- Whenever possible, consider fusing 'checkTarbomb' with packing / unpacking by using
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
-- with 'checkEntryTarbomb'.
-- Not only it is faster, but also alleviates issues with lazy I/O
-- such as exhaustion of file handlers.
checkTarbomb
:: FilePath
-> Entries e
Expand Down Expand Up @@ -217,6 +227,11 @@ instance Show TarBombError where
-- includes characters that are valid in both systems and the \'/\' vs \'\\\'
-- directory separator conventions.
--
-- Whenever possible, consider fusing 'checkPortability' with packing / unpacking by using
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
-- with 'checkEntryPortability'.
-- Not only it is faster, but also alleviates issues with lazy I/O
-- such as exhaustion of file handlers.
checkPortability
:: Entries e
-> GenEntries FilePath FilePath (Either (Either e DecodeLongNamesError) PortabilityError)
Expand Down

0 comments on commit 928c63c

Please sign in to comment.