diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-09-15 12:55:59 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-09-15 12:55:59 +0000 |
commit | 7892c494e7321c64b20bf7e1d794a6b6508fe84a (patch) | |
tree | abde252c0198e7fd43f6da119230208263f82c1c /source3/smbd/reply.c | |
parent | cde3f0fae15c977b8af28e3e2b327f4576c14e69 (diff) | |
download | samba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.tar.gz samba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.tar.bz2 samba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.zip |
Kill off the //server/share%user hack in share level security.
This should help make much of this code simpiler.
Andrew Bartlett
(This used to be commit fb0c3629c360fd0c57129500474960e6da6f9ef0)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r-- | source3/smbd/reply.c | 73 |
1 files changed, 8 insertions, 65 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 04dcf1c0a8..0b8f160854 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -163,7 +163,6 @@ int reply_tcon(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize) { pstring service; - pstring user; pstring password; pstring dev; int outsize = 0; @@ -174,47 +173,19 @@ int reply_tcon(connection_struct *conn, START_PROFILE(SMBtcon); - *service = *user = *password = *dev = 0; + *service = *password = *dev = 0; p = smb_buf(inbuf)+1; p += srvstr_pull(inbuf, service, p, sizeof(service), -1, STR_TERMINATE) + 1; p += srvstr_pull(inbuf, password, p, sizeof(password), -1, STR_TERMINATE) + 1; p += srvstr_pull(inbuf, dev, p, sizeof(dev), -1, STR_TERMINATE) + 1; - *user = 0; - p = strchr_m(service,'%'); - if (p != NULL) { - *p = 0; - fstrcpy(user,p+1); - } - p = strrchr_m(service,'\\'); if (p) { pstrcpy(service, p+1); } - /* - * 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)); - } else { - - /* - * Pass the user through the NT -> unix user mapping - * function. - */ - - (void)map_username(user); - - /* - * Do any UNIX username case mangling. - */ - (void)Get_Pwnam( user, True); - } - - conn = make_connection(service,user,password,pwlen,dev,vuid,&ecode); + conn = make_connection(service,password,pwlen,dev,vuid,&ecode); if (!conn) { END_PROFILE(SMBtcon); @@ -226,8 +197,8 @@ int reply_tcon(connection_struct *conn, SSVAL(outbuf,smb_vwv1,conn->cnum); SSVAL(outbuf,smb_tid,conn->cnum); - DEBUG(3,("tcon service=%s user=%s cnum=%d\n", - service, user, conn->cnum)); + DEBUG(3,("tcon service=%s cnum=%d\n", + service, conn->cnum)); END_PROFILE(SMBtcon); return(outsize); @@ -240,7 +211,6 @@ int reply_tcon(connection_struct *conn, int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize) { fstring service; - pstring user; pstring password; pstring devicename; NTSTATUS ecode; @@ -250,7 +220,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt char *p, *q; START_PROFILE(SMBtconX); - *service = *user = *password = *devicename = 0; + *service = *password = *devicename = 0; /* we might have to close an old one */ if ((SVAL(inbuf,smb_vwv2) & 0x1) && conn) { @@ -289,38 +259,11 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt else fstrcpy(service,path); - q = strchr_m(service,'%'); - if (q) { - *q++ = 0; - fstrcpy(user,q); - } p += srvstr_pull(inbuf, devicename, p, sizeof(devicename), 6, STR_ASCII); 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)); - } else { - - /* - * Pass the user through the NT -> unix user mapping - * function. - */ - - (void)map_username(user); - - /* - * Do any UNIX username case mangling. - */ - (void)Get_Pwnam(user, True); - - } - - conn = make_connection(service,user,password,passlen,devicename,vuid,&ecode); + conn = make_connection(service,password,passlen,devicename,vuid,&ecode); if (!conn) { END_PROFILE(SMBtconX); @@ -355,8 +298,8 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt } - DEBUG(3,("tconX service=%s user=%s\n", - service, user)); + DEBUG(3,("tconX service=%s \n", + service)); /* set the incoming and outgoing tid to the just created one */ SSVAL(inbuf,smb_tid,conn->cnum); |