mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-107811: tarfile: treat overflow in UID/GID as failure to set it (#108369)
This commit is contained in:
parent
72119d16a5
commit
5d18715765
2 changed files with 5 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue