summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2012-01-05 17:48:06 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2012-01-05 17:48:06 (GMT)
commitdee45e20f67f8d81de2d9c003ab18660036d5d73 (patch)
tree0411960ca9d7f6e78d1a938424b6f28833ca58f1 /Lib/tarfile.py
parentcdf6cd9ff30b75c72cbb8ad20293602a197dce6b (diff)
downloadcpython-dee45e20f67f8d81de2d9c003ab18660036d5d73.zip
cpython-dee45e20f67f8d81de2d9c003ab18660036d5d73.tar.gz
cpython-dee45e20f67f8d81de2d9c003ab18660036d5d73.tar.bz2
Issue #12926: Fix a bug in tarfile's link extraction.
On platforms that do not support (symbolic) links, tarfile offers a work-around and extracts a link in an archive as the regular file the link is pointing to. On other platforms, this code was accidentally executed even after the link had been successfully extracted which failed due to the already existing link.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 226d481..af32b0f 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2351,12 +2351,6 @@ class TarFile(object):
self._extract_member(self._find_link_target(tarinfo),
targetpath)
except symlink_exception:
- if tarinfo.issym():
- linkpath = os.path.join(os.path.dirname(tarinfo.name),
- tarinfo.linkname)
- else:
- linkpath = tarinfo.linkname
- else:
try:
self._extract_member(self._find_link_target(tarinfo),
targetpath)