diff options
author | jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> | 2021-03-23 09:14:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 09:14:48 -0700 |
commit | 6de9a3b187a27f16a595503892038ce69f70c87c (patch) | |
tree | 815fe0a24806854cf29a1d750590008825fd86f4 /infra | |
parent | e8646d25ecd0a93adb8cb3099064a4216529ecf7 (diff) | |
download | oss-fuzz-6de9a3b187a27f16a595503892038ce69f70c87c.tar.gz |
[helper] Fix handling of gsutil's 2FA (#5482)
gsutil recently started asking daily for a security key jiggle for accounts
using it. This means if we don't print stderr in real time, users won't see
why a corpus isn't downloading and helper will hang until 2FA request times out.
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/helper.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/infra/helper.py b/infra/helper.py index 6c2950ab4..e24df4ded 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -22,7 +22,6 @@ from multiprocessing.dummy import Pool as ThreadPool import argparse import datetime import errno -import multiprocessing import os import pipes import re @@ -687,14 +686,14 @@ def _get_latest_corpus(project_name, fuzz_target, base_corpus_dir): fuzz_target=fuzz_target) command = ['gsutil', 'ls', corpus_backup_url] - corpus_listing = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - output, error = corpus_listing.communicate() + # Don't capture stderr. We want it to print in real time, in case gsutil is + # asking for two-factor authentication. + corpus_listing = subprocess.Popen(command, stdout=subprocess.PIPE) + output, _ = corpus_listing.communicate() # Some fuzz targets (e.g. new ones) may not have corpus yet, just skip those. if corpus_listing.returncode: - print('WARNING: corpus for {0} not found:\n{1}'.format(fuzz_target, error), + print('WARNING: corpus for {0} not found:\n'.format(fuzz_target), file=sys.stderr) return @@ -751,7 +750,7 @@ def download_corpora(args): print('Downloading corpora for %s project to %s' % (args.project_name, corpus_dir)) - thread_pool = ThreadPool(multiprocessing.cpu_count()) + thread_pool = ThreadPool() return all(thread_pool.map(_download_for_single_target, fuzz_targets)) |