1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:torture/smb2: replace torture:cn_max_buffer_size option with the negotiated max trans size

Both:

 smbtorture //w2012r2-188/torture -Ua%b smb2.notify.valid-req --smb-ports=139

and:

 smbtorture //w2012r2-188/torture -Ua%b smb2.notify.valid-req --smb-ports=445

work against Windows 2008R2, 2012R2 and 2016 now and it reflects what
we have implemented in Samba.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13864

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2019-01-08 16:22:25 +01:00 committed by Jeremy Allison
parent d6fce7c0cb
commit 12fb3ec1dd
3 changed files with 4 additions and 14 deletions

View File

@ -91,15 +91,15 @@ static bool test_valid_request(struct torture_context *torture,
torture_comment(torture, "TESTING VALIDITY OF CHANGE NOTIFY REQUEST\n");
smb2_transport_credits_ask_num(tree->session->transport, 256);
smb2_util_unlink(tree, FNAME);
status = smb2_util_roothandle(tree, &dh);
CHECK_STATUS(status, NT_STATUS_OK);
/* 0x00080000 is the default max buffer size for Windows servers
* pre-Win7 */
max_buffer_size = torture_setting_ulong(torture, "cn_max_buffer_size",
0x00080000);
max_buffer_size =
smb2cli_conn_max_trans_size(tree->session->transport->conn);
n.in.recursive = 0x0000;
n.in.buffer_size = max_buffer_size;

View File

@ -528,8 +528,6 @@ int main(int argc, const char *argv[])
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k12", "true");
} else if (strcmp(target, "win7") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:win7", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:cn_max_buffer_size",
"0x00010000");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");

View File

@ -60,14 +60,6 @@ bool torture_parse_target(TALLOC_CTX *ctx,
* Because we use parametric options we do not need to define these parameters
* anywhere, we just define the meaning of each here.*/
/* torture:cn_max_buffer_size
*
* This parameter specifies the maximum buffer size given in a change notify
* request. If an overly large buffer is requested by a client, the server
* will return a STATUS_INVALID_PARAMETER. The max buffer size on Windows
* server pre-Win7 was 0x00080000. In Win7 this was reduced to 0x00010000.
*/
/* torture:invalid_lock_range_support
*
* This parameter specifies whether the server will return