Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tarfile.data_filter wrongly rejects some tarballs with symlinks #107845

Closed
Labels
3.10only security fixes3.11only security fixes3.12only security fixes3.13bugs and security fixes3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@encukou

Description

@encukou

My implementation ofPEP-706 has a bug: it wrongly determines the target of symlinks, and thus wrongly raisesLinkOutsideDestinationError on some valid tarballs.

I didn't pay enough attention to this quirk of the format (which I'd like to add toTarInfolinkname docs):

For symbolic links (SYMTYPE), the linkname is relative to the directory that contains the link.
For hard links (LNKTYPE), the linkname is relative to the root of the archive.

So, in a tarball that contains the following, the links point todir/target:

  • dir/target
  • other_dir/symlink ->../dir/target
  • other_dir/hardlink ->dir/target

Butdata_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixes3.13bugs and security fixes3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp