diff options
author | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2011-03-23 20:56:29 +0000 |
---|---|---|
committer | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2011-03-23 20:56:29 +0000 |
commit | dd6cc0cdb25f693bf310f3679d4509946bacc1ab (patch) | |
tree | cecfc92cb34d23f17abe8ea6af059832d81316ff | |
parent | 1960f7454e842451a4c2bb27b3488ea97b13e747 (diff) | |
download | python-setuptools-dd6cc0cdb25f693bf310f3679d4509946bacc1ab.tar.gz |
Fix rejecting filenames with '..' in them
git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@88794 6015fed2-1504-0410-9fe1-9d1591cc4771
-rwxr-xr-x | setuptools/archive_util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/archive_util.py b/setuptools/archive_util.py index 3afa68d..8930e1f 100755 --- a/setuptools/archive_util.py +++ b/setuptools/archive_util.py @@ -138,7 +138,7 @@ def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): name = info.filename # don't extract absolute paths or ones with .. in them - if name.startswith('/') or '..' in name: + if name.startswith('/') or '..' in name.split('/'): continue target = os.path.join(extract_dir, *name.split('/')) @@ -180,7 +180,7 @@ def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): for member in tarobj: name = member.name # don't extract absolute paths or ones with .. in them - if not name.startswith('/') and '..' not in name: + if not name.startswith('/') and '..' not in name.split('/'): dst = os.path.join(extract_dir, *name.split('/')) while member is not None and (member.islnk() or member.issym()): linkpath = member.linkname |