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.
This commit is contained in:
Todd C. Miller
2015-09-24 13:43:17 -06:00
parent 2c7ff33ea8
commit 0649a261e7

View File

@@ -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) {