#endif
void
-pam_password_change_required(int reqd)
+sshpam_password_change_required(int reqd)
{
debug3("%s %d", __func__, reqd);
if (sshpam_authctxt == NULL)
#ifndef USE_POSIX_THREADS
/* Import variables set by do_pam_account */
sshpam_account_status = buffer_get_int(b);
- pam_password_change_required(buffer_get_int(b));
+ sshpam_password_change_required(buffer_get_int(b));
/* Import environment from subprocess */
num_env = buffer_get_int(b);
* Conversation function for authentication thread.
*/
static int
-sshpam_thread_conv(int n, const struct pam_message **msg,
+sshpam_thread_conv(int n, struct pam_message **msg,
struct pam_response **resp, void *data)
{
Buffer buffer;
debug3("PAM: %s entering, %d messages", __func__, n);
*resp = NULL;
+ if (data == NULL) {
+ error("PAM: conversation function passed a null context");
+ return (PAM_CONV_ERR);
+ }
ctxt = data;
if (n <= 0 || n > PAM_MAX_NUM_MSG)
return (PAM_CONV_ERR);
u_int i;
const char *pam_user;
- pam_get_item(sshpam_handle, PAM_USER, (const void **)&pam_user);
+ pam_get_item(sshpam_handle, PAM_USER, (void **)&pam_user);
setproctitle("%s [pam]", pam_user);
environ[0] = NULL;
#endif
PAM_CHANGE_EXPIRED_AUTHTOK);
if (sshpam_err != PAM_SUCCESS)
goto auth_fail;
- pam_password_change_required(0);
+ sshpam_password_change_required(0);
}
}
}
static int
-sshpam_null_conv(int n, const struct pam_message **msg,
+sshpam_null_conv(int n, struct pam_message **msg,
struct pam_response **resp, void *data)
{
debug3("PAM: %s entering, %d messages", __func__, n);
if (sshpam_handle != NULL) {
/* We already have a PAM context; check if the user matches */
sshpam_err = pam_get_item(sshpam_handle,
- PAM_USER, (const void **)&pam_user);
+ PAM_USER, (void **)&pam_user);
if (sshpam_err == PAM_SUCCESS && strcmp(user, pam_user) == 0)
return (0);
pam_end(sshpam_handle, sshpam_err);
}
if (sshpam_err == PAM_NEW_AUTHTOK_REQD)
- pam_password_change_required(1);
+ sshpam_password_change_required(1);
sshpam_account_status = 1;
return (sshpam_account_status);
}
static int
-sshpam_tty_conv(int n, const struct pam_message **msg,
+sshpam_tty_conv(int n, struct pam_message **msg,
struct pam_response **resp, void *data)
{
char input[PAM_MAX_MSG_SIZE];
}
static int
-sshpam_store_conv(int n, const struct pam_message **msg,
+sshpam_store_conv(int n, struct pam_message **msg,
struct pam_response **resp, void *data)
{
struct pam_response *reply;
* display.
*/
static int
-sshpam_passwd_conv(int n, const struct pam_message **msg,
+sshpam_passwd_conv(int n, struct pam_message **msg,
struct pam_response **resp, void *data)
{
struct pam_response *reply;