summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-08-22 15:04:03 +0000
committerJeremy Allison <jra@samba.org>2013-08-23 09:48:40 -0700
commit1927676412a5b329b9f6e5e3ec3971bc18e21b31 (patch)
treed4914fc4bac3021c05a7d9454b2d16c57c1fa187 /source4/libcli
parent971b39bb103410444cfdeaa6e9684c7496a39ab3 (diff)
downloadsamba-1927676412a5b329b9f6e5e3ec3971bc18e21b31.tar.gz
samba-1927676412a5b329b9f6e5e3ec3971bc18e21b31.tar.bz2
samba-1927676412a5b329b9f6e5e3ec3971bc18e21b31.zip
libsmb2: Fix opening the rootdirectory, part 1
[MS-SMB2], 2.2.13 says: In the request, the Buffer field MUST be at least one byte in length. Implement that for the 0-length filename without create blobs. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/smb2/create.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index 1a7f02b070..10fe4f7ce3 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -294,6 +294,21 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
return NULL;
}
+ if (((io->in.fname == NULL) || (strlen(io->in.fname) == 0)) &&
+ (blob.length == 0)) {
+ struct smb2_request_buffer *buf = &req->out;
+
+ status = smb2_grow_buffer(buf, 1);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(req);
+ return NULL;
+ }
+ buf->dynamic[0] = 0;
+ buf->dynamic += 1;
+ buf->body_size += 1;
+ buf->size += 1;
+ }
+
data_blob_free(&blob);
smb2_transport_send(req);