test unknown tags and bad tag lengths
authorAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 06:59:12 +0000 (16:59 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 06:59:12 +0000 (16:59 +1000)
(This used to be commit 72902c1d0f85048adf3088b4f90bbc34858b8658)

source4/torture/smb2/create.c

index 070cb65c5cfa22e6590272eeef8e724344bc24f6..211b418a125b46c0f1bd3af33c3d97b0533627a9 100644 (file)
@@ -268,6 +268,25 @@ bool torture_smb2_create_blob(struct torture_context *torture, struct smb2_tree
        status = smb2_util_close(tree, io.out.file.handle);
        CHECK_STATUS(status, NT_STATUS_OK);
 
+       printf("testing unknown tag\n");
+       status = smb2_create_blob_add(tmp_ctx, &io.in.blobs,
+                                     "FooO", data_blob(NULL, 0));
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       status = smb2_create(tree, tmp_ctx, &io);
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       status = smb2_util_close(tree, io.out.file.handle);
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       printf("testing bad tag length\n");
+       status = smb2_create_blob_add(tmp_ctx, &io.in.blobs,
+                                     "xxx", data_blob(NULL, 0));
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       status = smb2_create(tree, tmp_ctx, &io);
+       CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+
        talloc_free(tmp_ctx);
 
        smb2_deltree(tree, FNAME);