mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
Password changing via PAM works now. DONT CHANGE THIS UNLESS YOU RE-TEST !!!!!!
Jeremy.
This commit is contained in:
parent
f4359b5f7f
commit
79574c07ed
@ -226,7 +226,9 @@ static struct chat_struct *make_pw_chat(char *p)
|
||||
|
||||
special_char_sub(prompt);
|
||||
fstrcpy(t->prompt, prompt);
|
||||
|
||||
strlower(t->prompt);
|
||||
trim_string(t->prompt, " ", " ");
|
||||
|
||||
if (!next_token(&p, reply, NULL, sizeof(fstring)))
|
||||
break;
|
||||
|
||||
@ -235,6 +237,8 @@ static struct chat_struct *make_pw_chat(char *p)
|
||||
|
||||
special_char_sub(reply);
|
||||
fstrcpy(t->reply, reply);
|
||||
strlower(t->reply);
|
||||
trim_string(t->reply, " ", " ");
|
||||
|
||||
}
|
||||
return list;
|
||||
@ -298,11 +302,19 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: PAM said: %s\n", msg[replies]->msg));
|
||||
fstrcpy(current_prompt, msg[replies]->msg);
|
||||
strlower(current_prompt);
|
||||
trim_string(current_prompt, " ", " ");
|
||||
for (t=pw_chat; t; t=t->next) {
|
||||
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: trying to match |%s| to |%s|\n",
|
||||
t->prompt, current_prompt ));
|
||||
|
||||
if (ms_fnmatch(t->prompt, current_prompt) == 0) {
|
||||
fstrcpy(current_reply, t->reply);
|
||||
pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We sent: %s\n", current_reply));
|
||||
pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
|
||||
#ifdef DEBUG_PASSWORD
|
||||
DEBUG(100,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We actualy sent: %s\n", current_reply));
|
||||
#endif
|
||||
reply[replies].resp_retcode = PAM_SUCCESS;
|
||||
reply[replies].resp = COPY_STRING(current_reply);
|
||||
found = True;
|
||||
@ -323,7 +335,12 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: PAM said: %s\n", msg[replies]->msg));
|
||||
fstrcpy(current_prompt, msg[replies]->msg);
|
||||
strlower(current_prompt);
|
||||
trim_string(current_prompt, " ", " ");
|
||||
for (t=pw_chat; t; t=t->next) {
|
||||
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: trying to match |%s| to |%s|\n",
|
||||
t->prompt, current_prompt ));
|
||||
|
||||
if (ms_fnmatch(t->prompt, current_prompt) == 0) {
|
||||
fstrcpy(current_reply, t->reply);
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: We sent: %s\n", current_reply));
|
||||
|
@ -226,7 +226,9 @@ static struct chat_struct *make_pw_chat(char *p)
|
||||
|
||||
special_char_sub(prompt);
|
||||
fstrcpy(t->prompt, prompt);
|
||||
|
||||
strlower(t->prompt);
|
||||
trim_string(t->prompt, " ", " ");
|
||||
|
||||
if (!next_token(&p, reply, NULL, sizeof(fstring)))
|
||||
break;
|
||||
|
||||
@ -235,6 +237,8 @@ static struct chat_struct *make_pw_chat(char *p)
|
||||
|
||||
special_char_sub(reply);
|
||||
fstrcpy(t->reply, reply);
|
||||
strlower(t->reply);
|
||||
trim_string(t->reply, " ", " ");
|
||||
|
||||
}
|
||||
return list;
|
||||
@ -298,11 +302,19 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: PAM said: %s\n", msg[replies]->msg));
|
||||
fstrcpy(current_prompt, msg[replies]->msg);
|
||||
strlower(current_prompt);
|
||||
trim_string(current_prompt, " ", " ");
|
||||
for (t=pw_chat; t; t=t->next) {
|
||||
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: trying to match |%s| to |%s|\n",
|
||||
t->prompt, current_prompt ));
|
||||
|
||||
if (ms_fnmatch(t->prompt, current_prompt) == 0) {
|
||||
fstrcpy(current_reply, t->reply);
|
||||
pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We sent: %s\n", current_reply));
|
||||
pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
|
||||
#ifdef DEBUG_PASSWORD
|
||||
DEBUG(100,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We actualy sent: %s\n", current_reply));
|
||||
#endif
|
||||
reply[replies].resp_retcode = PAM_SUCCESS;
|
||||
reply[replies].resp = COPY_STRING(current_reply);
|
||||
found = True;
|
||||
@ -323,7 +335,12 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: PAM said: %s\n", msg[replies]->msg));
|
||||
fstrcpy(current_prompt, msg[replies]->msg);
|
||||
strlower(current_prompt);
|
||||
trim_string(current_prompt, " ", " ");
|
||||
for (t=pw_chat; t; t=t->next) {
|
||||
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: trying to match |%s| to |%s|\n",
|
||||
t->prompt, current_prompt ));
|
||||
|
||||
if (ms_fnmatch(t->prompt, current_prompt) == 0) {
|
||||
fstrcpy(current_reply, t->reply);
|
||||
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: We sent: %s\n", current_reply));
|
||||
|
Loading…
x
Reference in New Issue
Block a user