diff options
author | Jeremy Allison <jra@samba.org> | 1998-06-10 19:45:13 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-06-10 19:45:13 +0000 |
commit | 72bf410b6e9b85f8fbff7f6175661829bef35f62 (patch) | |
tree | 11c6f694c2f4b4c3bb2e9325b071215a6d0dfbbf /source3/smbd | |
parent | 1b86bead993051f93ea1570ad404e270b06045d3 (diff) | |
download | samba-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')
-rw-r--r-- | source3/smbd/ipc.c | 26 | ||||
-rw-r--r-- | source3/smbd/reply.c | 41 |
2 files changed, 64 insertions, 3 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; diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 5ed30a7e8f..c9b0c6852d 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -232,6 +232,18 @@ int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize) parse_connect(smb_buf(inbuf)+1,service,user,password,&pwlen,dev); + /* + * Pass the user through the NT -> unix user mapping + * function. + */ + + map_username(user); + + /* + * Do any UNIX username case mangling. + */ + (void)Get_Pwnam( user, True); + connection_num = make_connection(service,user,password,pwlen,dev,vuid); if (connection_num < 0) @@ -300,6 +312,18 @@ int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize) DEBUG(4,("Got device type %s\n",devicename)); } + /* + * Pass the user through the NT -> unix user mapping + * function. + */ + + map_username(user); + + /* + * Do any UNIX username case mangling. + */ + (void)Get_Pwnam( user, True); + connection_num = make_connection(service,user,password,passlen,devicename,vuid); if (connection_num < 0) @@ -599,11 +623,22 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize) reload_services(True); + /* + * Pass the user through the NT -> unix user mapping + * function. + */ + + map_username(user); + + /* + * Do any UNIX username case mangling. + */ + (void)Get_Pwnam( user, True); + add_session_user(user); - /* Check if the given username was the guest user with no password. - We need to do this check after add_session_user() as that - call can potentially change the username (via map_user). + /* + * Check if the given username was the guest user with no password. */ if(!guest && strequal(user,lp_guestaccount(-1)) && (*smb_apasswd == 0)) |