Conversation
Documentation build overview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation only. No behaviour change.
tar_filterdoes not checkTarInfo.linkname, so a symbolic link member whose target isabsolute, or relative and climbing outside the destination, is extracted as given. Only
data_filterrefuses those. That is consistent with PEP 706 and I am not proposing to change it —but the docs never say it, and the containment bullet of
tar_filterreads as though they do:"(after following symlinks)" describes
realpath()on the member's own destination path, not thelink target the member creates. Today the non-guarantee is derivable only by noticing that
data_filtersays "In addition to whattar_filterdoes" and that link-target containment appearsonly in that second list.
The recently added normalization bullet sharpens this rather than covering it: it now warns that
removing internal
..components "may change the meaning of the name if it traverses symboliclinks", so the section does discuss symlinks — but only as they affect a member's own
name.linknameis still never mentioned.This adds two things:
'tar'entry of the filter list, since that list is where the choice between'tar'and'data'is actually made... warning::ontar_filterstating the non-guarantee positively and pointing atdata_filter. It is placed before the existing.. versionchanged::note so version historystays last.
Motivation and the measured behaviour (with controls, and with the scope limited to symbolic links,
which is what I verified) are in #156026. Briefly: five independent projects picked
'tar'in codewhose stated purpose is safe extraction —
unstructured-ingest,container-inspector,portage,poetry, and Samba'ssafe_tarfile.py, whose comment "which prevents escape" is close to averbatim restatement of the bullet above.
No
Misc/NEWS.dentry — docs-only change, so this should carryskip news.Happy to reword any of it; I care that the fact is stated somewhere in the
tar_filtersection,not about the phrasing.