2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Add pointer to a printf like function to plugin open functon.

This can be used instead of the conversation function to display
info and error messages.
This commit is contained in:
Todd C. Miller
2010-05-04 19:17:31 -04:00
parent b60b28abd1
commit 9fbec34fed
11 changed files with 160 additions and 157 deletions

View File

@@ -148,6 +148,7 @@ char *login_style;
#endif /* HAVE_BSD_AUTH_H */
sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp;
sudo_conv_t sudo_conv;
sudo_printf_t sudo_printf;
static char *runas_user;
static char *runas_group;
@@ -164,8 +165,8 @@ static int sudo_mode;
static int
sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
char * const settings[], char * const user_info[],
char * const envp[])
sudo_printf_t plugin_printf, char * const settings[],
char * const user_info[], char * const envp[])
{
int sources = 0;
sigaction_t sa;
@@ -179,7 +180,10 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
# endif
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
sudo_conv = conversation; /* XXX, stash elsewhere? */
if (!sudo_conv)
sudo_conv = conversation;
if (!sudo_printf)
sudo_printf = plugin_printf;
if (sigsetjmp(error_jmp, 1)) {
/* called via error(), errorx() or log_error() */