From 12fb3ec1dd886c15977ae9eb0b2b25f2017db10d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 8 Jan 2019 16:22:25 +0100 Subject: [PATCH] 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 Reviewed-by: Jeremy Allison --- source4/torture/smb2/notify.c | 8 ++++---- source4/torture/smbtorture.c | 2 -- source4/torture/smbtorture.h | 8 -------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c index a610fc62bd7..9b8a44fd49b 100644 --- a/source4/torture/smb2/notify.c +++ b/source4/torture/smb2/notify.c @@ -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; diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 15eb81b7fea..018f39f00d9 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -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"); diff --git a/source4/torture/smbtorture.h b/source4/torture/smbtorture.h index 5a75f06bce5..3a72e294806 100644 --- a/source4/torture/smbtorture.h +++ b/source4/torture/smbtorture.h @@ -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 -- 2.34.1