largest valid SMB 2.02 smb2create
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Sep 2011 16:49:45 +0000 (18:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 16 Jan 2018 06:45:28 +0000 (07:45 +0100)
source3/torture/test_smb2.c

index eb8b0b6ff49cf2f9128a3c53cfa93f3511c36e81..26a02210a99981b73ba558b8e4248fdff527be04 100644 (file)
@@ -45,6 +45,14 @@ bool run_smb2_basic(int dummy)
        uint32_t saved_tid = 0;
        struct smbXcli_tcon *saved_tcon = NULL;
        uint64_t saved_uid = 0;
+       struct smb2_create_blobs blobs;
+       uint8_t *xxxx = talloc_size(talloc_tos(), (0x800100-(4+SMB2_HDR_BODY+56+0x14)));
+       if (xxxx == NULL) {
+               printf("no mem\n");
+               return false;
+       }
+
+       ZERO_STRUCT(blobs);
 
        printf("Starting SMB2-BASIC\n");
 
@@ -71,6 +79,16 @@ bool run_smb2_basic(int dummy)
                return false;
        }
 
+       memset(xxxx, 'x', talloc_get_size(xxxx));
+
+       status = smb2_create_blob_add(cli, &blobs,
+                                     "xxxx",
+                                     data_blob_const(xxxx, talloc_get_size(xxxx)));
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("smb2_create_blob_add returned %s\n", nt_errstr(status));
+               return false;
+       }
+
        status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
                        cli->smb2.tcon, "smb2-basic.txt",
                        SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
@@ -80,7 +98,7 @@ bool run_smb2_basic(int dummy)
                        FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
                        FILE_CREATE, /* create_disposition, */
                        FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
+                       &blobs, /* smb2_create_blobs *blobs */
                        &fid_persistent,
                        &fid_volatile,
                        NULL, NULL, NULL);