comparison fetch.sh @ 21:1a22de6a6b1a

Script to fetch new corpus and update the repository
author Matt Johnston <matt@ucc.asn.au>
date Sun, 07 Mar 2021 16:06:25 +0800
parents
children 4032153b8b7a
comparison
equal deleted inserted replaced
20:6b857c4abe66 21:1a22de6a6b1a
1 #!/bin/sh
2
3 # Fetch new corpus from oss-fuzz and update the repository. Make sure you commit first!
4
5 # Before running you need to set up gcloud auth
6
7 set -x
8 set -e
9
10 FUZZERS=$(make list-fuzz-targets)
11
12 rm -rf dl
13 mkdir dl
14 for F in $FUZZERS; do
15 gsutil cp gs://dropbear-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/dropbear_$F/latest.zip dl/$F.zip
16 done
17
18 # need to use "xargs -n 200" to avoid "argument list too long"
19 rm -rf old
20 mkdir old
21 for F in $FUZZERS; do
22 mkdir old/$F
23 # 40 characters is a hash - those filenames came from a previous corpus
24 # we want to keep manually named files which are handcrafted seeds
25 echo $F/???????????????????????????????????????? | xargs -n 200 rm || true
26 # unzip overwrite, quiet
27 (cd $F; unzip -o -q ../dl/$F.zip)
28 done
29
30 hg addremove $FUZZERS