summaryrefslogtreecommitdiffstats
path: root/source/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-02 21:58:09 +0000
committerJeremy Allison <jra@samba.org>2001-10-02 21:58:09 +0000
commit9333bbeb7627c8b21a3eaeae1683c34e17d14bf0 (patch)
treed5181d7303f303b20de3db78bb4c1f58603e1bf9 /source/auth
parentb97fbfcd7cfbafc40b4be558fb8d6e86ad656cb0 (diff)
downloadsamba-9333bbeb7627c8b21a3eaeae1683c34e17d14bf0.tar.gz
samba-9333bbeb7627c8b21a3eaeae1683c34e17d14bf0.tar.xz
samba-9333bbeb7627c8b21a3eaeae1683c34e17d14bf0.zip
Fixed up the change password bug when not using PAM.
The problem is we were trying to use mask_match as a generic wildcard matcher for UNIX strings (like the password prompts). We can't do that - we need a unix_wild_match (re-added into lib/util.c) as the ms_fnmatch semantics for empty strings are completely wrong. This caused partial reads to be accepted as correct passwd change responses when they were not.... Also added paranioa test to stop passwd change being done as root with no %u in the passwd program string. Jeremy.
Diffstat (limited to 'source/auth')
-rw-r--r--source/auth/pampass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/auth/pampass.c b/source/auth/pampass.c
index 6d0dabcd9d0..0c7c4f12911 100644
--- a/source/auth/pampass.c
+++ b/source/auth/pampass.c
@@ -306,7 +306,7 @@ static int smb_pam_passchange_conv(int num_msg,
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: trying to match |%s| to |%s|\n",
t->prompt, current_prompt ));
- if (wild_match(t->prompt, current_prompt) == 0) {
+ if (unix_wild_match(t->prompt, current_prompt) == 0) {
fstrcpy(current_reply, t->reply);
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);
@@ -337,7 +337,7 @@ static int smb_pam_passchange_conv(int num_msg,
DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: trying to match |%s| to |%s|\n",
t->prompt, current_prompt ));
- if (wild_match(t->prompt, current_prompt) == 0) {
+ if (unix_wild_match(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));
pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);