Expand description
Entry-path containment: the single decision point for whether an archive entry’s name (or a symlink’s target) may be written under a destination directory.
Pure and filesystem-free by design — see the module-level doc comments on each function for why.
Enums§
- Name
Refusal - Why a filesystem refused a NAME: the one definition of “the filesystem refuses this name”, shared by extraction (which skips the entry) and the fuzz containment oracle (which cannot resolve such a link physically).
- Symlink
Verdict - What extraction may do with one symlink entry, decided by
classify_symlink_target. A genuine escape is not a verdict: it isErr(Error::UnsafePath), exit 7.
Functions§
- check_
symlink_ target - Refuses a symlink whose target would resolve outside
dest. - classify_
symlink_ target - Decides one symlink entry named
entry, to be created atlink_path(whatsafe_joinproduced for it) pointing attarget: create it, skip it, or refuse the extraction. The one owner of that rule — extraction, the hard-link-to-a-symlink path and the fuzz oracle’s lexical rule all ask it. - name_
refused_ by_ filesystem - Whether
eis the filesystem refusing a NAME, and why. - safe_
join - Joins
entry_nameontodest, refusing anything that escapes.