diff --git a/lib/util/sudo_debug.c b/lib/util/sudo_debug.c index 976920d1b..b60980247 100644 --- a/lib/util/sudo_debug.c +++ b/lib/util/sudo_debug.c @@ -122,6 +122,9 @@ static char sudo_debug_pidstr[(((sizeof(int) * 8) + 2) / 3) + 3]; static size_t sudo_debug_pidlen; static const int num_subsystems = NUM_SUBSYSTEMS; +/* Exposed for sudo_printf.c */ +void sudo_debug_write_file(const char *func, const char *file, int line, const char *str, int len, int errno_val); + /* * Parse settings string from sudo.conf and open debugfile. * Returns 1 on success, 0 if cannot open debugfile. @@ -331,7 +334,7 @@ sudo_debug_write_conv(const char *func, const char *file, int lineno, } } -static void +void sudo_debug_write_file(const char *func, const char *file, int lineno, const char *str, int len, int errnum) { diff --git a/lib/util/sudo_printf.c b/lib/util/sudo_printf.c index d5b86809a..22aea0451 100644 --- a/lib/util/sudo_printf.c +++ b/lib/util/sudo_printf.c @@ -33,6 +33,9 @@ #include "sudo_plugin.h" #include "sudo_debug.h" +/* Not exported outside libsudo_util */ +void sudo_debug_write_file(const char *func, const char *file, int line, const char *str, int len, int errno_val); + __dso_public int _sudo_printf(int msg_type, const char *fmt, ...) { @@ -57,7 +60,7 @@ _sudo_printf(int msg_type, const char *fmt, ...) len = vasprintf(&buf, fmt, ap); va_end(ap); if (len != -1) - sudo_debug_write(buf, len, 0); + sudo_debug_write_file(NULL, NULL, 0, buf, len, 0); break; default: errno = EINVAL;