Move _sudo_printf from src/conversation.c to common/sudo_printf.c.
Add sudo_printf function pointer that is initialized to _sudo_printf() instead of requiring a sudo_conv function pointer everywhere. The plugin will reset sudo_printf to point to the version passed in via the plugin open function. Now plugin_error.c can just call sudo_printf in all cases. The sudoers binaries no longer need their own version of sudo_printf.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#define _SUDO_ERROR_H_
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <sudo_plugin.h>
|
||||
|
||||
/*
|
||||
* We wrap error/errorx and warn/warnx so that the same output can
|
||||
@@ -170,6 +171,8 @@
|
||||
warning_restore_locale(); \
|
||||
} while (0)
|
||||
|
||||
extern sudo_printf_t sudo_printf;
|
||||
|
||||
void error2(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
|
||||
void errorx2(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
|
||||
void verror2(int, const char *, va_list ap) __attribute__((__noreturn__));
|
||||
|
Reference in New Issue
Block a user