summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-10 19:45:13 +0000
committerJeremy Allison <jra@samba.org>1998-06-10 19:45:13 +0000
commit72bf410b6e9b85f8fbff7f6175661829bef35f62 (patch)
tree11c6f694c2f4b4c3bb2e9325b071215a6d0dfbbf /source3/smbd/ipc.c
parent1b86bead993051f93ea1570ad404e270b06045d3 (diff)
downloadsamba-72bf410b6e9b85f8fbff7f6175661829bef35f62.tar.gz
samba-72bf410b6e9b85f8fbff7f6175661829bef35f62.tar.bz2
samba-72bf410b6e9b85f8fbff7f6175661829bef35f62.zip
De-coupled the mapping of a Windows to UNIX username from the Get_Pwnam
username case conversion wrapper. It is now (very) explicit where we are mapping between an incoming Windows username, and when we are doing a UNIX password entry lookup, which may change the case of the given username. This makes things *much* clearer (IMHO:-) and will ease the adding of the 'groupname map' parameter, and the addition of the special 'jeremy' mode for Samba where unix users will not be needed. (We must think of a better name for it :-). Jeremy. (This used to be commit fb6ed81844e7cb6049749e43ac9b4adfaf4ca2de)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index a9e0bec3ed..f92e376575 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -1633,6 +1633,18 @@ static BOOL api_SetUserPassword(int cnum,uint16 vuid, char *param,char *data,
DEBUG(3,("Set password for <%s>\n",user));
/*
+ * Pass the user through the NT -> unix user mapping
+ * function.
+ */
+
+ map_username(user);
+
+ /*
+ * Do any UNIX username case mangling.
+ */
+ (void)Get_Pwnam( user, True);
+
+ /*
* Attempt the plaintext password change first.
* Older versions of Windows seem to do this.
*/
@@ -1706,6 +1718,20 @@ static BOOL api_SamOEMChangePassword(int cnum,uint16 vuid, char *param,char *dat
fstrcpy(user,p);
p = skip_string(p,1);
+ DEBUG(3,("api_SamOEMChangePassword: Change password for <%s>\n",user));
+
+ /*
+ * Pass the user through the NT -> unix user mapping
+ * function.
+ */
+
+ map_username(user);
+
+ /*
+ * Do any UNIX username case mangling.
+ */
+ (void)Get_Pwnam( user, True);
+
if(check_oem_password( user, (unsigned char *)data, &sampw,
new_passwd, (int)sizeof(new_passwd)) == False) {
return True;