If logsrvd_config not set fall back to using stderr for warnings.
Also fix fuzz_logsrvd_conf link error.
This commit is contained in:
@@ -1282,6 +1282,10 @@ logsrvd_conv_syslog(int num_msgs, const struct sudo_conv_message msgs[],
|
|||||||
int i;
|
int i;
|
||||||
debug_decl(logsrvd_conv_syslog, SUDO_DEBUG_UTIL);
|
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. */
|
/* Also write to stderr if still in the foreground. */
|
||||||
if (logsrvd_is_early()) {
|
if (logsrvd_is_early()) {
|
||||||
(void)logsrvd_conv_stderr(num_msgs, msgs, replies, callback);
|
(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;
|
int i;
|
||||||
debug_decl(logsrvd_conv_logfile, SUDO_DEBUG_UTIL);
|
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. */
|
/* Also write to stderr if still in the foreground. */
|
||||||
if (logsrvd_is_early()) {
|
if (logsrvd_is_early()) {
|
||||||
(void)logsrvd_conv_stderr(num_msgs, msgs, replies, callback);
|
(void)logsrvd_conv_stderr(num_msgs, msgs, replies, callback);
|
||||||
|
@@ -41,6 +41,12 @@
|
|||||||
#include "log_server.pb-c.h"
|
#include "log_server.pb-c.h"
|
||||||
#include "logsrvd.h"
|
#include "logsrvd.h"
|
||||||
|
|
||||||
|
bool
|
||||||
|
logsrvd_is_early(void)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user