diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-21 20:18:48 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-21 20:18:48 +0000 |
commit | a364047b2a8dc76db39989570a1a3d22bcc214ec (patch) | |
tree | 375c561929cef1ed55065b693ff519617707a121 /source/smbd/reply.c | |
parent | 66c4640f6520a3d7e2669687146b46e598880197 (diff) | |
download | samba-a364047b2a8dc76db39989570a1a3d22bcc214ec.tar.gz samba-a364047b2a8dc76db39989570a1a3d22bcc214ec.tar.xz samba-a364047b2a8dc76db39989570a1a3d22bcc214ec.zip |
Andrew - please look this over. I've fixed a long standing (maybe 4-5
years old) bug when chainging a sessionsetup_and_X and tcon together.
The wrong username was being entered into the tdb, even though the
correct user was used for accessing files. This is related to the fact
that authorise_login() is not used for sessionsetup, but only for tcon
auths.
Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r-- | source/smbd/reply.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d86d882cdd7..c98375792e2 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -164,11 +164,10 @@ static int connection_error(char *inbuf,char *outbuf,int ecode) return(ERROR(ERRSRV,ecode)); } - - /**************************************************************************** parse a share descriptor string ****************************************************************************/ + static void parse_connect(char *p,char *service,char *user, char *password,int *pwlen,char *dev) { @@ -222,6 +221,14 @@ int reply_tcon(connection_struct *conn, parse_connect(smb_buf(inbuf)+1,service,user,password,&pwlen,dev); + /* + * If the vuid is valid, we should be using that.... + */ + + if (*user == '\0' && (lp_security() != SEC_SHARE) && validated_username(vuid)) { + pstrcpy(user,validated_username(vuid)); + } + /* * Ensure the user and password names are in UNIX codepage format. */ @@ -264,6 +271,7 @@ int reply_tcon(connection_struct *conn, /**************************************************************************** Reply to a tcon and X. ****************************************************************************/ + int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize) { fstring service; @@ -315,6 +323,14 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt DEBUG(4,("Got device type %s\n",devicename)); /* + * If the vuid is valid, we should be using that.... + */ + + if (*user == '\0' && (lp_security() != SEC_SHARE) && validated_username(vuid)) { + pstrcpy(user,validated_username(vuid)); + } + + /* * Ensure the user and password names are in UNIX codepage format. */ @@ -389,7 +405,6 @@ int reply_unknown(char *inbuf,char *outbuf) return(ERROR(ERRSRV,ERRunknownsmb)); } - /**************************************************************************** reply to an ioctl ****************************************************************************/ |