]> granicus.if.org Git - sudo/commitdiff
Fix passing of the callback pointer to the conversation function.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 19:43:17 +0000 (13:43 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 19:43:17 +0000 (13:43 -0600)
This was preventing the on_suspend and on_resume functions from
being called on PAM systems.

plugins/sudoers/auth/pam.c

index 4c85ebb6a0f3113a3fbd597353d7abf839acbab5..afb05392ad1a99c41572f0befdff4378ea22c261 100644 (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) {