mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #14160: TarFile.extractfile() failed to resolve symbolic links when
the links were not located in an archive subdirectory.
This commit is contained in:
parent
13c598b1d8
commit
231d474a7b
4 changed files with 7 additions and 1 deletions
|
|
@ -2397,7 +2397,7 @@ class TarFile(object):
|
|||
"""
|
||||
if tarinfo.issym():
|
||||
# Always search the entire archive.
|
||||
linkname = os.path.dirname(tarinfo.name) + "/" + tarinfo.linkname
|
||||
linkname = "/".join(filter(None, (os.path.dirname(tarinfo.name), tarinfo.linkname)))
|
||||
limit = None
|
||||
else:
|
||||
# Search the archive before the link, because a hard link is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue