1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-11 08:23:49 +03:00

Fixed SMB2 rename operations from Vista clients

We needed a flag in bufinfo to mark packets as SMB2, as it seems that
SMB2 uses a different format for the RenameInformation buffer than SMB
does

Also handle the fact that SMB2 clients give the full path to the
target file in the rename, not a relative path
This commit is contained in:
Andrew Tridgell
2008-02-14 12:30:31 +11:00
parent ca6d9be6cb
commit 52d7972d95
8 changed files with 59 additions and 30 deletions

View File

@@ -38,7 +38,10 @@
void smb_setup_bufinfo(struct smbcli_request *req)
{
req->in.bufinfo.mem_ctx = req;
req->in.bufinfo.unicode = (req->flags2 & FLAGS2_UNICODE_STRINGS)?true:false;
req->in.bufinfo.flags = 0;
if (req->flags2 & FLAGS2_UNICODE_STRINGS) {
req->in.bufinfo.flags = BUFINFO_FLAG_UNICODE;
}
req->in.bufinfo.align_base = req->in.buffer;
req->in.bufinfo.data = req->in.data;
req->in.bufinfo.data_size = req->in.data_size;
@@ -658,7 +661,7 @@ size_t smbcli_req_pull_string(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_c
char **dest, const uint8_t *src, int byte_len, uint_t flags)
{
if (!(flags & STR_ASCII) &&
(((flags & STR_UNICODE) || bufinfo->unicode))) {
(((flags & STR_UNICODE) || (bufinfo->flags & BUFINFO_FLAG_UNICODE)))) {
return smbcli_req_pull_ucs2(bufinfo, mem_ctx, dest, src, byte_len, flags);
}