Commit 954176c3 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Ignore PAX entries when checking for tarbombs

When checking for tarbombs, ignore PAX entry types 'g' and 'x'.
These do not get extracted so their names do not matter.
parent 4182cfc0
......@@ -446,6 +446,15 @@ checkEntrySecurity entry = case entryContent entry of
| otherwise = Nothing
checkEntryTarbomb :: FilePath -> Entry -> Maybe String
checkEntryTarbomb _ entry | nonFilesystemEntry = Nothing
-- Ignore some special entries we will not unpack anyway
nonFilesystemEntry =
case entryContent entry of
OtherEntryType 'g' _ _ -> True --PAX global header
OtherEntryType 'x' _ _ -> True --PAX individual header
_ -> False
checkEntryTarbomb expectedTopDir entry =
case FilePath.Native.splitDirectories (entryPath entry) of
(topDir:_) | topDir == expectedTopDir -> Nothing
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment