summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2011-09-05 14:59:44 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2011-09-05 14:59:44 (GMT)
commit24757851b7f95a4fbb6ecef1354b12c426a0c5e5 (patch)
treebe7b803acb66107f847cfda765f16956e1b2a69c /Lib
parent6a8c8a80a1c47595652a267665bdbae2bd8489f0 (diff)
parent2e7ddd374b48649b34db6f86313379080de24280 (diff)
downloadcpython-24757851b7f95a4fbb6ecef1354b12c426a0c5e5.zip
cpython-24757851b7f95a4fbb6ecef1354b12c426a0c5e5.tar.gz
cpython-24757851b7f95a4fbb6ecef1354b12c426a0c5e5.tar.bz2
Merge with 3.2: Issue #12841: Fix tarfile extraction of non-existent uids/gids.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/tarfile.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 6bdbf36..2560562 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2366,17 +2366,11 @@ class TarFile(object):
try:
g = grp.getgrnam(tarinfo.gname)[2]
except KeyError:
- try:
- g = grp.getgrgid(tarinfo.gid)[2]
- except KeyError:
- g = os.getgid()
+ g = tarinfo.gid
try:
u = pwd.getpwnam(tarinfo.uname)[2]
except KeyError:
- try:
- u = pwd.getpwuid(tarinfo.uid)[2]
- except KeyError:
- u = os.getuid()
+ u = tarinfo.uid
try:
if tarinfo.issym() and hasattr(os, "lchown"):
os.lchown(targetpath, u, g)