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,7 +95,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
FILE *fp; FILE *fp;
setprogname("fuzz_iolog_json"); setprogname("fuzz_iolog_json");
sudo_warn_set_conversation(fuzz_conversation); if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
sudo_warn_set_conversation(fuzz_conversation);
fp = open_data(data, size); fp = open_data(data, size);
if (fp == NULL) if (fp == NULL)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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