Skip to content

Commit

Permalink
Run checkSecurity on all entries during 'pack'
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Dec 2, 2023
1 parent aeae6e1 commit a18cae2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Codec/Archive/Tar/Pack.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,18 @@ packPaths secCB baseDir paths =
case tarpathRes of
FileNameEmpty -> throwIO $ userError "File name empty"
FileNameOK tarpath
| isSymlink -> (:[]) <$> packSymlinkEntry abspath tarpath
| isDir -> (:[]) <$> packDirectoryEntry abspath tarpath
| otherwise -> (:[]) <$> packFileEntry abspath tarpath
| isSymlink -> do
e <- packSymlinkEntry abspath tarpath
secCB Nothing Nothing e
pure [e]
| isDir -> do
e <- packDirectoryEntry abspath tarpath
secCB Nothing Nothing e
pure [e]
| otherwise -> do
e <- packFileEntry abspath tarpath
secCB Nothing Nothing e
pure [e]
FileNameTooLong tarpath
| isSymlink -> do
linkTarget <- getSymbolicLinkTarget abspath
Expand Down

0 comments on commit a18cae2

Please sign in to comment.