Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,8 @@ def chown(self, tarinfo, targetpath, numeric_owner):
os.lchown(targetpath, u, g)
else:
os.chown(targetpath, u, g)
except OSError as e:
except (OSError, OverflowError) as e:
# OverflowError can be raised if an ID doesn't fit in `id_t`
raise ExtractError("could not change owner") from e

def chmod(self, tarinfo, targetpath):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:mod:`tarfile`: extraction of members with overly large UID or GID (e.g. on
an OS with 32-bit :c:type:`!id_t`) now fails in the same way as failing to
set the ID.