mirror of https://github.com/google/oss-fuzz.git
[infra] Fix java coverage (#5747)
* Filter non-fuzz target binaries in coverage script * Filter non-fuzz target binaries in helper.py * Fix fuzz target executable bit check in helper.py Python and JVM fuzz target executables created via the docs template set the exectuable via `chmod u+x` as the root user, which means that os.access checks in infra/helper.py don't see the exectuable bit if not run as root locally. With this commit, the check now looks for any of the three exectuable bits.
This commit is contained in:
parent
774abe3bd3
commit
124db941a7
|
@ -19,7 +19,12 @@ cd $OUT
|
|||
if (( $# > 0 )); then
|
||||
FUZZ_TARGETS="$@"
|
||||
else
|
||||
FUZZ_TARGETS="$(find . -maxdepth 1 -type f -executable -printf '%P\n')"
|
||||
FUZZ_TARGETS="$(find . -maxdepth 1 -type f -executable -printf '%P\n' | \
|
||||
grep -v -x -F \
|
||||
-e 'llvm-symbolizer' \
|
||||
-e 'jazzer_agent_deploy.jar' \
|
||||
-e 'jazzer_driver' \
|
||||
-e 'jazzer_driver_asan')"
|
||||
fi
|
||||
|
||||
DUMPS_DIR="$OUT/dumps"
|
||||
|
|
|
@ -680,9 +680,15 @@ def _get_fuzz_targets(project_name):
|
|||
for name in os.listdir(_get_out_dir(project_name)):
|
||||
if name.startswith('afl-'):
|
||||
continue
|
||||
if name.startswith('jazzer_'):
|
||||
continue
|
||||
if name == 'llvm-symbolizer':
|
||||
continue
|
||||
|
||||
path = os.path.join(_get_out_dir(project_name), name)
|
||||
if os.path.isfile(path) and os.access(path, os.X_OK):
|
||||
# Python and JVM fuzz targets are only executable for the root user, so
|
||||
# we can't use os.access.
|
||||
if os.path.isfile(path) and (os.stat(path).st_mode & 0o111):
|
||||
fuzz_targets.append(name)
|
||||
|
||||
return fuzz_targets
|
||||
|
|
Loading…
Reference in New Issue