Use initprogname(), not setprogname() in the fuzzers.
This results in better coverage for progname.c.
This commit is contained in:
@@ -96,7 +96,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
struct eventlog *evlog = NULL;
|
||||
FILE *fp;
|
||||
|
||||
setprogname("fuzz_iolog_json");
|
||||
initprogname("fuzz_iolog_json");
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
||||
|
@@ -94,7 +94,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
struct eventlog *evlog = NULL;
|
||||
FILE *fp;
|
||||
|
||||
setprogname("fuzz_iolog_legacy");
|
||||
initprogname("fuzz_iolog_legacy");
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
||||
|
@@ -77,7 +77,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
char logdir[] = "/tmp/timing.XXXXXX";
|
||||
int dfd = -1, fd = -1;
|
||||
|
||||
setprogname("fuzz_iolog_timing");
|
||||
initprogname("fuzz_iolog_timing");
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
||||
|
@@ -76,7 +76,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
size_t nwritten;
|
||||
int fd;
|
||||
|
||||
setprogname("fuzz_sudo_conf");
|
||||
initprogname("fuzz_sudo_conf");
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
||||
|
@@ -98,7 +98,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
size_t nwritten;
|
||||
int fd;
|
||||
|
||||
setprogname("fuzz_logsrvd_conf");
|
||||
initprogname("fuzz_logsrvd_conf");
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
||||
|
@@ -266,7 +266,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
if (fp == NULL)
|
||||
return 0;
|
||||
|
||||
setprogname("fuzz_policy");
|
||||
initprogname("fuzz_policy");
|
||||
sudoers_debug_register(getprogname(), NULL);
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
@@ -208,7 +208,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
if (fp == NULL)
|
||||
return 0;
|
||||
|
||||
setprogname("fuzz_sudoers");
|
||||
initprogname("fuzz_sudoers");
|
||||
sudoers_debug_register(getprogname(), NULL);
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
@@ -132,7 +132,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
if (fp == NULL)
|
||||
return 0;
|
||||
|
||||
setprogname("fuzz_sudoers_ldif");
|
||||
initprogname("fuzz_sudoers_ldif");
|
||||
sudoers_debug_register(getprogname(), NULL);
|
||||
if (getenv("SUDO_FUZZ_VERBOSE") == NULL)
|
||||
sudo_warn_set_conversation(fuzz_conversation);
|
||||
|
Reference in New Issue
Block a user