Repository navigation
gh-160097: Reject links replacing the destination in tarfile.tar_filter - #160098
Conversation
Documentation build overview
|
| # would replace it with a (sym)link, redirecting the destination | ||
| # for all subsequent members. | ||
| if ((member.islnk() or member.issym()) | ||
| and os.path.normpath(name) == os.curdir): |
There was a problem hiding this comment.
The old check compared the member's real path against the real path of the destination directory, this was incorrect. For example, a link named x was rejected whenever an earlier x -> . symlink existed, even though extracting it only replaces that symlink (and never touches the destination directory).
CC @gps-head
|
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13, 3.14, 3.15. |
|
GH-160339 is a backport of this pull request to the 3.15 branch. |
|
GH-160340 is a backport of this pull request to the 3.14 branch. |
|
GH-160341 is a backport of this pull request to the 3.13 branch. |
|
GH-160342 is a backport of this pull request to the 3.12 branch. |
|
GH-160343 is a backport of this pull request to the 3.11 branch. |
tarfile.tar_filterdoesn't handle symlinks with empty names #160097