s3:smb2cli: SMB2_TCON needs one dyn byte to that the structure size check works.
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Sep 2011 16:22:57 +0000 (18:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 7 Sep 2011 06:33:38 +0000 (08:33 +0200)
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze

source3/libsmb/smb2cli_tcon.c

index 2872c371c05307ac5a145d65bf74e7a006605608..c51418227da9b7c4c084728813192841d6746006 100644 (file)
@@ -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,