Commit 257c9b2a authored by Rico Wind's avatar Rico Wind Committed by Commit Bot

Use extended path syntax on windows when extracting tarball in download script

R=hinoka@chromium.org

Bug:
Change-Id: I027ac560beeea2ebf38fe6ddcb4e707efd3f615a
Reviewed-on: https://chromium-review.googlesource.com/538612Reviewed-by: 's avatarRyan Tseng <hinoka@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Rico Wind <ricow@chromium.org>
parent 62619a38
......@@ -284,6 +284,11 @@ def _downloader_worker_thread(thread_num, q, force, base_url,
continue
with tarfile.open(output_filename, 'r:gz') as tar:
dirname = os.path.dirname(os.path.abspath(output_filename))
# If there are long paths inside the tarball we can get extraction
# errors on windows due to the 260 path length limit (this includes
# pwd). Use the extended path syntax.
if sys.platform == 'win32':
dirname = '\\\\?\\%s' % dirname
if not _validate_tar_file(tar, os.path.basename(extract_dir)):
out_q.put('%d> Error: %s contains files outside %s.' % (
thread_num, output_filename, extract_dir))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment