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:
Todd C. Miller
2012-11-25 09:34:33 -05:00
parent 5496ffe1e8
commit c2c6616a0c
23 changed files with 128 additions and 221 deletions

View File

@@ -56,8 +56,6 @@ __dso_public int main(int argc, char *argv[]);
struct interface *interfaces;
sudo_printf_t sudo_printf = check_addr_printf;
sudo_conv_t sudo_conv; /* NULL in non-plugin */
static int
check_addr(char *input)
{
@@ -156,7 +154,7 @@ main(int argc, char *argv[])
/* STUB */
void
cleanup(int gotsig)
sudoers_cleanup(int gotsig)
{
return;
}