-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarfile.data_filter wrongly rejects some tarballs with symlinks #107845
Comments
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…GH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
3.13 PR is merged. |
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (pythonGH-108209) pythongh-107845: Fix symlink handling for tarfile.data_filter (pythonGH-107846) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
…ythonGH-107846) (python#108274) (cherry picked from commit acbd3f9) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
Ready to close this issue? |
Yes, thank you for the ping. sys.version_info[:3] in {(3, 8, 17), (3, 9, 17), (3, 10, 12), (3, 11, 4)} |
…y python versions - see: python/cpython#107845
* Add test for install and standalone on windows. * Test in venv. * Skip Manager. * Fix activate command. * Update. * Update. * improve platform system determination * `DependencyCompiler`: add `reqs` parameter to `.Download` and `.Wheel` methods * refactored tarball creation/extraction to use `create_tarball`/`extract_tarball` * skip uv wheel when dehydrating standalone python on windows * small fixup to joining python standalone download url * improve parsing of reqs from reqFile * add `tarfile.data_filter` to all tar filters to address secruity audit * revert tar security fix, since `tarfile.data_filter` is busted in many python versions - see: python/cpython#107845 * add numpy<2 override on windows --------- Co-authored-by: telamonian <telamonian@users.noreply.github.com>
My implementation of PEP-706 has a bug: it wrongly determines the target of symlinks, and thus wrongly raises
LinkOutsideDestinationError
on some valid tarballs.I didn't pay enough attention to this quirk of the format (which I'd like to add to TarInfolinkname docs):
So, in a tarball that contains the following, the links point to
dir/target
:dir/target
other_dir/symlink
->../dir/target
other_dir/hardlink
->dir/target
But
data_filter
thinks thatother_dir/symlink
will point to../dir target
outside the destination directory.I have a fix but would like to test it more next week, before merging.
Sorry for the extra work this'll cause for a lot of people :(
Linked PRs
The text was updated successfully, but these errors were encountered: