From 3ae4d22406602f618081b51db7430d249cc16e17 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 11:12:54 +0000 Subject: [PATCH] - handle CORE protocol better - handle case where director exists when untarring (This used to be commit 7d7bad70d3b6b37037ad96b34e17a927675cde11) --- source3/client/client.c | 69 +++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index 504cb5a0bb4..5542e2f479d 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2131,13 +2131,12 @@ static void cmd_mput(void) strcpy(rname,cur_dir); strcat(rname,lname); - if (!do_mkdir(rname)) - { - strcat(lname,"/"); - if (!seek_list(f,lname)) - break; - goto again1; - } + if (!chkpath(rname,False) && !do_mkdir(rname)) { + strcat(lname,"/"); + if (!seek_list(f,lname)) + break; + goto again1; + } continue; } @@ -3182,19 +3181,36 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu strcpy(pword, ""); passlen=1; } - set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True); - CVAL(outbuf,smb_com) = SMBtconX; - setup_pkt(outbuf); - - SSVAL(outbuf,smb_vwv0,0xFF); - SSVAL(outbuf,smb_vwv3,passlen); + if (Protocol <= PROTOCOL_CORE) { + set_message(outbuf,0,6 + strlen(service) + passlen + strlen(dev),True); + CVAL(outbuf,smb_com) = SMBtcon; + setup_pkt(outbuf); - p = smb_buf(outbuf); - memcpy(p,pword,passlen); - p += passlen; - strcpy(p,service); - p = skip_string(p,1); - strcpy(p,dev); + p = smb_buf(outbuf); + *p++ = 0x04; + strcpy(p, service); + p = skip_string(p,1); + *p++ = 0x04; + memcpy(p,pword,passlen); + p += passlen; + *p++ = 0x04; + strcpy(p, dev); + } + else { + set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True); + CVAL(outbuf,smb_com) = SMBtconX; + setup_pkt(outbuf); + + SSVAL(outbuf,smb_vwv0,0xFF); + SSVAL(outbuf,smb_vwv3,passlen); + + p = smb_buf(outbuf); + memcpy(p,pword,passlen); + p += passlen; + strcpy(p,service); + p = skip_string(p,1); + strcpy(p,dev); + } } send_smb(Client,outbuf); @@ -3225,11 +3241,18 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu } - max_xmit = MIN(max_xmit,BUFFER_SIZE-4); - if (max_xmit <= 0) - max_xmit = BUFFER_SIZE - 4; + if (Protocol <= PROTOCOL_CORE) { + max_xmit = SVAL(inbuf,smb_vwv0); - cnum = SVAL(inbuf,smb_tid); + cnum = SVAL(inbuf,smb_vwv1); + } + else { + max_xmit = MIN(max_xmit,BUFFER_SIZE-4); + if (max_xmit <= 0) + max_xmit = BUFFER_SIZE - 4; + + cnum = SVAL(inbuf,smb_tid); + } DEBUG(3,("Connected with cnum=%d max_xmit=%d\n",cnum,max_xmit)); -- 2.34.1