diff options
Diffstat (limited to 'lib/fuzzing/oss-fuzz')
-rwxr-xr-x | lib/fuzzing/oss-fuzz/build_samba.sh | 11 | ||||
-rwxr-xr-x | lib/fuzzing/oss-fuzz/check_build.sh | 16 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/fuzzing/oss-fuzz/build_samba.sh b/lib/fuzzing/oss-fuzz/build_samba.sh index ff382e22a25..b27c7b7d5c8 100755 --- a/lib/fuzzing/oss-fuzz/build_samba.sh +++ b/lib/fuzzing/oss-fuzz/build_samba.sh @@ -110,4 +110,15 @@ do # Truncate the original binary to save space echo -n > $x + done + +# Grap the seeds dictionary from github and put the seed zips in place +# beside their executables. + +wget https://gitlab.com/samba-team/samba-fuzz-seeds/-/jobs/artifacts/master/download?job=zips \ + -O seeds.zip + +# We might not have unzip, but we do have python +$PYTHON -mzipfile -e seeds.zip $OUT +rm -f seeds.zip diff --git a/lib/fuzzing/oss-fuzz/check_build.sh b/lib/fuzzing/oss-fuzz/check_build.sh index cc69cf26418..b971d2c1bb0 100755 --- a/lib/fuzzing/oss-fuzz/check_build.sh +++ b/lib/fuzzing/oss-fuzz/check_build.sh @@ -13,8 +13,15 @@ OUT=$1 # build_samba.sh will have put a non-zero number of fuzzers here. If # there are none, this will fail as it becomes literally fuzz_* + +seeds_found=no + for bin in $OUT/fuzz_* do + # we only want to look at the elf files, not the zips + if [ ${bin%_seed_corpus.zip} != $bin ]; then + continue + fi # Confirm that the chrpath was reset to lib/ in the same directory # as the binary chrpath -l $bin | grep 'RUNPATH=$ORIGIN/lib' @@ -22,4 +29,13 @@ do # Confirm that we link to at least some libraries in this # directory (shows that the libraries were found and copied). ldd $bin | grep "$OUT/lib" + + if [ -f ${bin}_seed_corpus.zip ]; then + seeds_found=yes + fi done + +if [ $seeds_found = no ]; then + echo "no seed zip files were found!" + exit 1 +fi |