diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-12-01 03:16:59 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-12-01 03:16:59 +0000 |
commit | 3924f97eac23a38c110fc6ae764f8b02ac636fde (patch) | |
tree | efe0695bbf7a025ca9315328f28b46c3e310c52a /source3/smbd | |
parent | 8f84d170af0cdf55d02558cc51ac77c344990ac6 (diff) | |
download | samba-3924f97eac23a38c110fc6ae764f8b02ac636fde.tar.gz samba-3924f97eac23a38c110fc6ae764f8b02ac636fde.tar.bz2 samba-3924f97eac23a38c110fc6ae764f8b02ac636fde.zip |
No need for fstring manipulation here (Tcon&X), just use string pointers.
Andrew Bartlett
(This used to be commit b072bb9c8469799734507bcdffd4be29211e2610)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 2c29ffdf51..d09beb7429 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -202,7 +202,7 @@ int reply_tcon(connection_struct *conn, int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize) { - fstring service; + const char *service; DATA_BLOB password; pstring devicename; NTSTATUS nt_status; @@ -213,7 +213,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt extern BOOL global_encrypted_passwords_negotiated; START_PROFILE(SMBtconX); - *service = *devicename = 0; + *devicename = 0; /* we might have to close an old one */ if ((SVAL(inbuf,smb_vwv2) & 0x1) && conn) { @@ -233,26 +233,28 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt } p = smb_buf(inbuf) + passlen; + p += srvstr_pull_buf(inbuf, path, p, sizeof(path), STR_TERMINATE); /* * the service name can be either: \\server\share * or share directly like on the DELL PowerVault 705 */ + if (*path=='\\') { q = strchr_m(path+2,'\\'); if (!q) { END_PROFILE(SMBtconX); return(ERROR_DOS(ERRDOS,ERRnosuchshare)); } - fstrcpy(service,q+1); + service = q+1; } else - fstrcpy(service,path); + service = path; p += srvstr_pull(inbuf, devicename, p, sizeof(devicename), 6, STR_ASCII); - DEBUG(4,("Got device type %s\n",devicename)); + DEBUG(4,("Got device type %s for %s\n",devicename, service)); conn = make_connection(service,password,devicename,vuid,&nt_status); |