s4:torture/smb2: replace torture:cn_max_buffer_size option with the negotiated max...
authorStefan Metzmacher <metze@samba.org>
Tue, 8 Jan 2019 15:22:25 +0000 (16:22 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Mar 2019 23:09:37 +0000 (23:09 +0000)
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>
source4/torture/smb2/notify.c
source4/torture/smbtorture.c
source4/torture/smbtorture.h

index a610fc62bd74f295b8a59396beb32207b2206970..9b8a44fd49bb9f76acdf51d607590d57cee12394 100644 (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;
index 15eb81b7feaecd5e9d2626b5678f65fea40385f3..018f39f00d9ee42e6000ce6cf09f9f71cd76b30a 100644 (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");
 
index 5a75f06bce53039745bf553d3ac15067184d5fed..3a72e294806924a4b85083c5b8cd7179fb0b1a87 100644 (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