1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Stop coredump on pam password change with pam_pwdb.so module on error.

Jeremy.
(This used to be commit d9b960b4a5)
This commit is contained in:
Jeremy Allison 2001-05-01 18:19:15 +00:00
parent 5197ccfef4
commit e2a997f7a9
2 changed files with 10 additions and 2 deletions

View File

@ -188,6 +188,7 @@ static int smb_pam_passchange_conv(int num_msg,
for (replies = 0; replies < num_msg; replies++) {
switch (msg[replies]->msg_style) {
case PAM_PROMPT_ECHO_ON:
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: Replied: %s\n", msg[replies]->msg));
reply[replies].resp_retcode = PAM_SUCCESS;
reply[replies].resp = COPY_STRING(udp->PAM_username);
/* PAM frees resp */
@ -195,7 +196,7 @@ static int smb_pam_passchange_conv(int num_msg,
case PAM_PROMPT_ECHO_OFF:
reply[replies].resp_retcode = PAM_SUCCESS;
DEBUG(10,("smb_pam_passchange_conv: PAM Replied: %s\n", msg[replies]->msg));
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: Replied: %s\n", msg[replies]->msg));
if (strncmp(currentpw_prompt, msg[replies]->msg, strlen(currentpw_prompt)) == 0) {
reply[replies].resp = COPY_STRING(udp->PAM_password);
} else if (strncmp(newpw_prompt, msg[replies]->msg, strlen(newpw_prompt)) == 0) {
@ -206,6 +207,9 @@ static int smb_pam_passchange_conv(int num_msg,
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
DEBUG(5,("smb_pam_passchange_conv: Prompts available:\n CurrentPW: \"%s\"\n NewPW: \"%s\"\n \
RepeatPW: \"%s\"\n",currentpw_prompt,newpw_prompt,repeatpw_prompt));
free(reply);
reply = NULL;
return PAM_CONV_ERR;
}
/* PAM frees resp */
break;

View File

@ -188,6 +188,7 @@ static int smb_pam_passchange_conv(int num_msg,
for (replies = 0; replies < num_msg; replies++) {
switch (msg[replies]->msg_style) {
case PAM_PROMPT_ECHO_ON:
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: Replied: %s\n", msg[replies]->msg));
reply[replies].resp_retcode = PAM_SUCCESS;
reply[replies].resp = COPY_STRING(udp->PAM_username);
/* PAM frees resp */
@ -195,7 +196,7 @@ static int smb_pam_passchange_conv(int num_msg,
case PAM_PROMPT_ECHO_OFF:
reply[replies].resp_retcode = PAM_SUCCESS;
DEBUG(10,("smb_pam_passchange_conv: PAM Replied: %s\n", msg[replies]->msg));
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: Replied: %s\n", msg[replies]->msg));
if (strncmp(currentpw_prompt, msg[replies]->msg, strlen(currentpw_prompt)) == 0) {
reply[replies].resp = COPY_STRING(udp->PAM_password);
} else if (strncmp(newpw_prompt, msg[replies]->msg, strlen(newpw_prompt)) == 0) {
@ -206,6 +207,9 @@ static int smb_pam_passchange_conv(int num_msg,
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
DEBUG(5,("smb_pam_passchange_conv: Prompts available:\n CurrentPW: \"%s\"\n NewPW: \"%s\"\n \
RepeatPW: \"%s\"\n",currentpw_prompt,newpw_prompt,repeatpw_prompt));
free(reply);
reply = NULL;
return PAM_CONV_ERR;
}
/* PAM frees resp */
break;