If logsrvd_config not set fall back to using stderr for warnings.

Also fix fuzz_logsrvd_conf link error.
This commit is contained in:
Todd C. Miller
2021-06-13 18:42:09 -06:00
parent 2c1988410e
commit d311c7b2ee
2 changed files with 14 additions and 0 deletions

View File

@@ -1282,6 +1282,10 @@ logsrvd_conv_syslog(int num_msgs, const struct sudo_conv_message msgs[],
int i;
debug_decl(logsrvd_conv_syslog, SUDO_DEBUG_UTIL);
if (logsrvd_config == NULL) {
debug_return_int(logsrvd_conv_stderr(num_msgs, msgs, replies, callback));
}
/* Also write to stderr if still in the foreground. */
if (logsrvd_is_early()) {
(void)logsrvd_conv_stderr(num_msgs, msgs, replies, callback);
@@ -1362,6 +1366,10 @@ logsrvd_conv_logfile(int num_msgs, const struct sudo_conv_message msgs[],
int i;
debug_decl(logsrvd_conv_logfile, SUDO_DEBUG_UTIL);
if (logsrvd_config == NULL) {
debug_return_int(logsrvd_conv_stderr(num_msgs, msgs, replies, callback));
}
/* Also write to stderr if still in the foreground. */
if (logsrvd_is_early()) {
(void)logsrvd_conv_stderr(num_msgs, msgs, replies, callback);

View File

@@ -41,6 +41,12 @@
#include "log_server.pb-c.h"
#include "logsrvd.h"
bool
logsrvd_is_early(void)
{
return true;
}
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{