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:
@@ -377,9 +377,10 @@ sudo_pam_end_session(struct passwd *pw, sudo_auth *auth)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
converse(int num_msg, PAM_CONST struct pam_message **msg,
|
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 pam_response *pr;
|
||||||
|
struct sudo_conv_callback *callback = NULL;
|
||||||
PAM_CONST struct pam_message *pm;
|
PAM_CONST struct pam_message *pm;
|
||||||
const char *prompt;
|
const char *prompt;
|
||||||
char *pass;
|
char *pass;
|
||||||
@@ -398,6 +399,9 @@ converse(int num_msg, PAM_CONST struct pam_message **msg,
|
|||||||
debug_return_int(PAM_BUF_ERR);
|
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++) {
|
for (pr = *response, pm = *msg, n = num_msg; n--; pr++, pm++) {
|
||||||
type = SUDO_CONV_PROMPT_ECHO_OFF;
|
type = SUDO_CONV_PROMPT_ECHO_OFF;
|
||||||
switch (pm->msg_style) {
|
switch (pm->msg_style) {
|
||||||
|
Reference in New Issue
Block a user