mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
- handle CORE protocol better
- handle case where director exists when untarring
(This used to be commit 7d7bad70d3
)
This commit is contained in:
parent
d4010fc355
commit
3ae4d22406
@ -2131,13 +2131,12 @@ static void cmd_mput(void)
|
|||||||
|
|
||||||
strcpy(rname,cur_dir);
|
strcpy(rname,cur_dir);
|
||||||
strcat(rname,lname);
|
strcat(rname,lname);
|
||||||
if (!do_mkdir(rname))
|
if (!chkpath(rname,False) && !do_mkdir(rname)) {
|
||||||
{
|
strcat(lname,"/");
|
||||||
strcat(lname,"/");
|
if (!seek_list(f,lname))
|
||||||
if (!seek_list(f,lname))
|
break;
|
||||||
break;
|
goto again1;
|
||||||
goto again1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3182,19 +3181,36 @@ static BOOL send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setu
|
|||||||
strcpy(pword, ""); passlen=1;
|
strcpy(pword, ""); passlen=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_message(outbuf,4,2 + strlen(service) + passlen + strlen(dev),True);
|
if (Protocol <= PROTOCOL_CORE) {
|
||||||
CVAL(outbuf,smb_com) = SMBtconX;
|
set_message(outbuf,0,6 + strlen(service) + passlen + strlen(dev),True);
|
||||||
setup_pkt(outbuf);
|
CVAL(outbuf,smb_com) = SMBtcon;
|
||||||
|
setup_pkt(outbuf);
|
||||||
|
|
||||||
SSVAL(outbuf,smb_vwv0,0xFF);
|
p = smb_buf(outbuf);
|
||||||
SSVAL(outbuf,smb_vwv3,passlen);
|
*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);
|
||||||
|
|
||||||
p = smb_buf(outbuf);
|
SSVAL(outbuf,smb_vwv0,0xFF);
|
||||||
memcpy(p,pword,passlen);
|
SSVAL(outbuf,smb_vwv3,passlen);
|
||||||
p += passlen;
|
|
||||||
strcpy(p,service);
|
p = smb_buf(outbuf);
|
||||||
p = skip_string(p,1);
|
memcpy(p,pword,passlen);
|
||||||
strcpy(p,dev);
|
p += passlen;
|
||||||
|
strcpy(p,service);
|
||||||
|
p = skip_string(p,1);
|
||||||
|
strcpy(p,dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
send_smb(Client,outbuf);
|
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 (Protocol <= PROTOCOL_CORE) {
|
||||||
if (max_xmit <= 0)
|
max_xmit = SVAL(inbuf,smb_vwv0);
|
||||||
max_xmit = BUFFER_SIZE - 4;
|
|
||||||
|
|
||||||
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));
|
DEBUG(3,("Connected with cnum=%d max_xmit=%d\n",cnum,max_xmit));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user