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

gh-127987: Ensure that directories are not renamed duringtar.TarFile.extractall()#134628

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
noamcohen97 wants to merge10 commits intopython:main
base:main
Choose a base branch
Loading
fromnoamcohen97:tar-arbitrary-file-chmod

Conversation

noamcohen97
Copy link
Contributor

@noamcohen97noamcohen97 commentedMay 24, 2025
edited by bedevere-appbot
Loading

The most straightforward approach to solving this issue is to re-consult thefilter_function just before updating the attributes in the directory withinextract_all(). However, this would result instateful extraction filters receiving a redundant call for a file that has already passed the filter.

Inspired byGNU Tar, I decided to save the exact inode number of the created directory to ensure it hasn't changed.
The only downside I can see is thatstat() is called shortly after the directory is created, which introduces a race condition. Since the entire module is already susceptible to these kinds of races (the path is resolved in thefilter_function and then re-resolved in the actual file creation methods), I believe this is acceptable.

@noamcohen97
Copy link
ContributorAuthor

@sethmlarson Please let me know what your thoughts are on this one

@noamcohen97noamcohen97force-pushed thetar-arbitrary-file-chmod branch from31dddea toba8c0f5CompareMay 24, 2025 14:52
@noamcohen97noamcohen97force-pushed thetar-arbitrary-file-chmod branch fromba8c0f5 to0e2d157CompareMay 24, 2025 16:07
it doesn't have to do with this bug
Copy link
Contributor

@sharktidesharktide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A news entry would be best here

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sharktidesharktidesharktide requested changes

@ethanfurmanethanfurmanAwaiting requested review from ethanfurmanethanfurman will be requested when the pull request is marked ready for reviewethanfurman is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@noamcohen97@sharktide

[8]ページ先頭

©2009-2025 Movatter.jp