summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-05 18:22:57 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 08:33:38 +0200
commit884a5a620f06c76c8b800fa5ddfbaf8dce240563 (patch)
tree72c5e8a6dbe5b01b69f56557af838c74edf5ee73 /source3/libsmb
parent85b393a199c633acaec68591c2b3940fdb5fbf99 (diff)
downloadsamba-884a5a620f06c76c8b800fa5ddfbaf8dce240563.tar.gz
samba-884a5a620f06c76c8b800fa5ddfbaf8dce240563.tar.bz2
samba-884a5a620f06c76c8b800fa5ddfbaf8dce240563.zip
s3:smb2cli: SMB2_TCON needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise. metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/smb2cli_tcon.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/smb2cli_tcon.c b/source3/libsmb/smb2cli_tcon.c
index 2872c371c0..c51418227d 100644
--- a/source3/libsmb/smb2cli_tcon.c
+++ b/source3/libsmb/smb2cli_tcon.c
@@ -28,6 +28,7 @@
struct smb2cli_tcon_state {
struct cli_state *cli;
uint8_t fixed[8];
+ uint8_t dyn_pad[1];
};
static void smb2cli_tcon_done(struct tevent_req *subreq);
@@ -70,6 +71,11 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx,
SSVAL(fixed, 4, SMB2_HDR_BODY + 8);
SSVAL(fixed, 6, dyn_len);
+ if (dyn_len == 0) {
+ dyn = state->dyn_pad;;
+ dyn_len = sizeof(state->dyn_pad);
+ }
+
subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_TCON,
0, 0, /* flags */
cli->smb2.pid,