Skip to content

Commit 928c63c

Browse files
committed
More comments on checks
1 parent ab25f73 commit 928c63c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Codec/Archive/Tar/Check/Internal.hs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ import qualified System.FilePath.Posix as FilePath.Posix
7070
-- link target. A failure in any entry terminates the sequence of entries with
7171
-- an error.
7272
--
73+
-- Whenever possible, consider fusing 'checkSecurity' with packing / unpacking by using
74+
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
75+
-- with 'checkEntrySecurity'.
76+
-- Not only it is faster, but also alleviates issues with lazy I/O
77+
-- such as exhaustion of file handlers.
7378
checkSecurity
7479
:: Entries e
7580
-> GenEntries FilePath FilePath (Either (Either e DecodeLongNamesError) FileNameError)
@@ -154,6 +159,11 @@ showFileNameError mb_plat err = case err of
154159
-- Note: This check must be used in conjunction with 'checkSecurity'
155160
-- (or 'checkPortability').
156161
--
162+
-- Whenever possible, consider fusing 'checkTarbomb' with packing / unpacking by using
163+
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
164+
-- with 'checkEntryTarbomb'.
165+
-- Not only it is faster, but also alleviates issues with lazy I/O
166+
-- such as exhaustion of file handlers.
157167
checkTarbomb
158168
:: FilePath
159169
-> Entries e
@@ -217,6 +227,11 @@ instance Show TarBombError where
217227
-- includes characters that are valid in both systems and the \'/\' vs \'\\\'
218228
-- directory separator conventions.
219229
--
230+
-- Whenever possible, consider fusing 'checkPortability' with packing / unpacking by using
231+
-- 'Codec.Archive.Tar.packAndCheck' / 'Codec.Archive.Tar.unpackAndCheck'
232+
-- with 'checkEntryPortability'.
233+
-- Not only it is faster, but also alleviates issues with lazy I/O
234+
-- such as exhaustion of file handlers.
220235
checkPortability
221236
:: Entries e
222237
-> GenEntries FilePath FilePath (Either (Either e DecodeLongNamesError) PortabilityError)

0 commit comments

Comments
 (0)