10000 gh-108948: tarfile should handle sticky bit in FreeBSD by sorcio · Pull Request #108950 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

8000 gh-108948: tarfile should handle sticky bit in FreeBSD #108950

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

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
document tarfile behavior with sticky bit on files
  • Loading branch information
sorcio committed Sep 16, 2023
commit 060bcb208bf04073b58ed271adf4b1ee41ab0910
7 changes: 7 additions & 0 deletions Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,13 @@ reused in custom filters:

This implements the ``'fully_trusted'`` filter.

.. note::

Although the filter preserves all permission bits unchanged, the sticky
bit (:const:`~stat.S_ISVTX`) will not be set on extracted files when the
system does not allow it. For compatibility reasons, no error is raised
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
system does not allow it. For compatibility reasons, no error is raised
system does not allow it for the current user. For compatibility reasons, no error is raised

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh, yeah, it's right that running as root will set the sticky bit in the cases we are testing. But I don't want to suggest it's a permissions issue (which would likely raise EPERM), or to imply more than is necessary. E.g. I think file system implementations on Linux are allowed to silently drop the bit if they don't support it regardless of the user. What do you think is worth clarifying in this context?

Copy link
Member

Choose a reason for hiding this comment

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

You can ignore my suggestion if you think that it's irrelevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rephrased ever so slightly for readability, but I avoided the "for the current user" part because it feels out of place.

in this case.

.. function:: tar_filter(member, path)

Implements the ``'tar'`` filter.
Expand Down
0