summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-01-25 01:21:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:10 -0500
commit8bf94dc7f79d4f1dcad312cffe6f70bada3d9c2f (patch)
tree2c6fc19d650b29a696eea25a1ed1ee9aedb005ab /source4/torture
parentc108689bf69bd7ac863b94b4535ddf4c51531fc5 (diff)
downloadsamba-8bf94dc7f79d4f1dcad312cffe6f70bada3d9c2f.tar.gz
samba-8bf94dc7f79d4f1dcad312cffe6f70bada3d9c2f.tar.bz2
samba-8bf94dc7f79d4f1dcad312cffe6f70bada3d9c2f.zip
r4973: Add a RAP scanner to smbtorture. win2k has call numbers 0-215 although
the cifs tr lists 250-318 also. (This used to be commit 37b4d1a676f341bc32a2a5a49fdfe2667636ccef)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rap/rap.c32
-rw-r--r--source4/torture/torture.c1
2 files changed, 31 insertions, 2 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 0080a80951..ec2a351ddf 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -2,6 +2,7 @@
Unix SMB/CIFS implementation.
test suite for various RAP operations
Copyright (C) Volker Lendecke 2004
+ Copyright (C) Tim Potter 2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -183,8 +184,10 @@ static NTSTATUS rap_cli_do_call(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
trans.in.trans_name = "\\PIPE\\LANMAN";
NDR_CHECK(ndr_push_uint16(params, call->callno));
- NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->paramdesc));
- NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->datadesc));
+ if (call->paramdesc)
+ NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->paramdesc));
+ if (call->datadesc)
+ NDR_CHECK(ndr_push_string(params, NDR_SCALARS, call->datadesc));
param_blob = ndr_push_blob(call->ndr_push_param);
NDR_CHECK(ndr_push_bytes(params, param_blob.data,
@@ -445,3 +448,28 @@ BOOL torture_raw_rap(void)
talloc_destroy(mem_ctx);
return ret;
}
+
+BOOL torture_rap_scan(void)
+{
+ struct smbcli_state *cli;
+ uint16 callno;
+
+ if (!torture_open_connection(&cli)) {
+ return False;
+ }
+
+ for (callno = 0; callno < 0xffff; callno++) {
+ struct rap_call *call = new_rap_cli_call(callno);
+ NTSTATUS result;
+
+ result = rap_cli_do_call(cli, cli, call);
+
+ if (NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER))
+ printf("callno %d is RAP call\n", callno);
+
+ destroy_rap_call(call);
+ }
+
+ torture_close_connection(cli);
+ return True;
+}
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 638150e91b..e41e183537 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -2380,6 +2380,7 @@ static struct {
{"SCAN-CASETABLE", torture_casetable, 0},
{"SCAN-PIPE_NUMBER", run_pipe_number, 0},
{"SCAN-IOCTL", torture_ioctl_test, 0},
+ {"SCAN-RAP", torture_rap_scan, 0},
/* rpc testers */
{"RPC-LSA", torture_rpc_lsa, 0},