Do not disable fuzzer output if SUDO_FUZZ_VERBOSE env variable is set.

This commit is contained in:
Todd C. Miller
2022-02-22 12:04:10 -07:00
parent 2911c31dd7
commit 41bc52302b
8 changed files with 16 additions and 8 deletions

View File

@@ -95,6 +95,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
FILE *fp;
setprogname("fuzz_iolog_json");
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
fp = open_data(data, size);

View File

@@ -93,6 +93,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
FILE *fp;
setprogname("fuzz_iolog_legacy");
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
fp = open_data(data, size);

View File

@@ -76,6 +76,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
int dfd = -1, fd = -1;
setprogname("fuzz_iolog_timing");
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* I/O logs consist of multiple files in a directory. */

View File

@@ -67,6 +67,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
int fd;
setprogname("fuzz_sudo_conf");
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* sudo_conf_read() uses a conf file path, not an open file. */

View File

@@ -76,6 +76,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
int fd;
setprogname("fuzz_logsrvd_conf");
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* logsrvd_conf_read() uses a conf file path, not an open file. */

View File

@@ -264,6 +264,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
setprogname("fuzz_policy");
sudoers_debug_register(getprogname(), NULL);
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* user_info and settings must be non-NULL (even if empty). */

View File

@@ -188,6 +188,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
setprogname("fuzz_sudoers");
sudoers_debug_register(getprogname(), NULL);
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* Sudoers locale setup. */

View File

@@ -133,6 +133,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
setprogname("fuzz_sudoers_ldif");
sudoers_debug_register(getprogname(), NULL);
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
/* Initialize defaults and parse LDIF-format sudoers. */