Skip to content
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

test_tar test_add_dir_getmember fails if uid/gid is larger than 16777215 #95675

Closed
colesbury opened this issue Aug 4, 2022 · 3 comments
Closed
Assignees
Labels
3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Aug 4, 2022

Bug report

The test_add_dir_getmember added in #30283 fails if the current user's uid or gid is larger than 16777215 because of limitations of UStar format.

Note that the other test cases don't have this problem.

This test should either avoid depending on the current user's uid/gid (such as by using an explicit uid/gid) or be skipped if the current uid/gid is 8**8 or larger.

For example,

def filter(tarinfo):
 tarinfo.uid = 100
 tarinfo.gid = 100
 return tarinfo

...
tar.add(name, filter=filter)

Will use 100 as the uid and gid instead of the current user's uid/gid.

Linked PRs

@colesbury colesbury added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir 3.11 only security fixes 3.10 only security fixes 3.9 only security fixes 3.12 bugs and security fixes labels Aug 4, 2022
@corona10
Copy link
Member

@colesbury
I will try to introduce this issue into the internal OSS sprint as the good first bug.
I will delegate the issue to my mentees.

@uyw4687
Copy link
Contributor

uyw4687 commented Feb 20, 2023

I'll take it :)

uyw4687 added a commit to uyw4687/cpython that referenced this issue Feb 24, 2023
uyw4687 added a commit to uyw4687/cpython that referenced this issue Feb 24, 2023
corona10 pushed a commit that referenced this issue Feb 25, 2023
Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 25, 2023
…02207)

(cherry picked from commit 56e93c8)

Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 25, 2023
…02207)

(cherry picked from commit 56e93c8)

Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
@corona10 corona10 removed the 3.9 only security fixes label Feb 25, 2023
corona10 pushed a commit that referenced this issue Feb 25, 2023
gh-102231)

gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207)
(cherry picked from commit 56e93c8)

Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
corona10 pushed a commit that referenced this issue Feb 25, 2023
gh-102230)

gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207)
(cherry picked from commit 56e93c8)

Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
@corona10
Copy link
Member

Thank you @uyw4687!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants