summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--Lib/tarfile.py6
-rw-r--r--Misc/NEWS2
2 files changed, 2 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)
diff --git a/Misc/NEWS b/Misc/NEWS
index 08f897f..7adf4f7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,8 @@ Core and Builtins
Library
-------
+- Issue #12926: Fix a bug in tarfile's link extraction.
+
- Issue #13696: Fix the 302 Relative URL Redirection problem.
- Issue #13636: Weak ciphers are now disabled by default in the ssl module