From 0649a261e70fe6101e270bc018181a51452cac9c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 24 Sep 2015 13:43:17 -0600 Subject: [PATCH] Fix passing of the callback pointer to the conversation function. This was preventing the on_suspend and on_resume functions from being called on PAM systems. --- plugins/sudoers/auth/pam.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/auth/pam.c b/plugins/sudoers/auth/pam.c index 4c85ebb6a..afb05392a 100644 --- a/plugins/sudoers/auth/pam.c +++ b/plugins/sudoers/auth/pam.c @@ -377,9 +377,10 @@ sudo_pam_end_session(struct passwd *pw, sudo_auth *auth) */ static int converse(int num_msg, PAM_CONST struct pam_message **msg, - struct pam_response **response, void *callback) + struct pam_response **response, void *vcallback) { struct pam_response *pr; + struct sudo_conv_callback *callback = NULL; PAM_CONST struct pam_message *pm; const char *prompt; char *pass; @@ -398,6 +399,9 @@ converse(int num_msg, PAM_CONST struct pam_message **msg, debug_return_int(PAM_BUF_ERR); } + if (vcallback != NULL) + callback = *((struct sudo_conv_callback **)vcallback); + for (pr = *response, pm = *msg, n = num_msg; n--; pr++, pm++) { type = SUDO_CONV_PROMPT_ECHO_OFF; switch (pm->msg_style) {