summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2022-12-29 13:22:29 -0700
committerTodd C. Miller <Todd.Miller@sudo.ws>2022-12-29 13:22:29 -0700
commitbac367c419c63f1440cf68ff593a3c00f8f47124 (patch)
tree07014927bc311a96849c0c6d9b3f776ecb1d60e5 /configure.ac
parentda4b636a971af05908282e26324e4d41711b04c2 (diff)
downloadsudo-bac367c419c63f1440cf68ff593a3c00f8f47124.tar.gz
Avoid using our function replacements when fuzzing (where possible).
We don't want to fuzz the function replacements themselves as this can skew the coverage reports.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 15 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 8d67657c6..25abf27f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2089,17 +2089,21 @@ case "$host" in
# We call getrandom via syscall(3) in case it is not in libc
AC_CHECK_HEADERS([linux/random.h sys/syscall.h])
- # The glibc getentropy() emulation may fail on older kernels.
- # We use our own getentropy() by default on Linux.
- : ${ac_cv_func_getentropy='no'}
-
- # The glibc arc4random() may fail in chroot on older kernels.
- # We use our own arc4random() by default on Linux.
- : ${ac_cv_func_arc4random='no'}
-
- # The glibc closefrom() emulation may fail in chroot.
- # We use our own closefrom() by default on Linux.
- : ${ac_cv_func_closefrom='no'}
+ # Do not use our replacement functions when fuzzing, it may
+ # skew the coverage reports.
+ if test X"$enable_fuzzer" != X"no"; then
+ # glibc's getentropy() emulation may fail on older kernels.
+ # We use our own getentropy() by default on Linux.
+ : ${ac_cv_func_getentropy='no'}
+
+ # glibc's arc4random() may fail in chroot on older kernels.
+ # We use our own arc4random() by default on Linux.
+ : ${ac_cv_func_arc4random='no'}
+
+ # glibc's closefrom() emulation may fail in chroot.
+ # We use our own closefrom() by default on Linux.
+ : ${ac_cv_func_closefrom='no'}
+ fi
# Linux 3.2 supports reading/writing a another process
# without using ptrace(2).