mirror of https://github.com/python/cpython
gh-107811: tarfile: treat overflow in UID/GID as failure to set it (#108369)
This commit is contained in:
parent
72119d16a5
commit
5d18715765
|
@ -2557,7 +2557,8 @@ class TarFile(object):
|
|||
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):
|
||||
|
|
|
@ -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.
|
Loading…
Reference in New Issue