summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-08-23 16:24:29 +0000
committerAndrew Tridgell <tridge@samba.org>2001-08-23 16:24:29 +0000
commit9e21abd3148f3d2911078666e75d5fc7218418eb (patch)
tree4bb0a93a6c2be547979bf652be59aa79aecb22b0
parent9168c29a03a67028795ce1d126d49980ad7e456a (diff)
downloadsamba-9e21abd3148f3d2911078666e75d5fc7218418eb.tar.gz
samba-9e21abd3148f3d2911078666e75d5fc7218418eb.tar.bz2
samba-9e21abd3148f3d2911078666e75d5fc7218418eb.zip
the beginnings of a TRANS2 scanner
(This used to be commit 9c483987a5d136bf23018ade6ceecf603f8f1614)
-rw-r--r--source3/torture/torture.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 9483f25ad0..525b7644ae 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -2154,6 +2154,71 @@ static BOOL run_trans2test(int dummy)
return correct;
}
+
+/****************************************************************************
+check for existance of a trans2 call
+****************************************************************************/
+static BOOL scan_trans2(struct cli_state *cli, int op, int level)
+{
+ int data_len = 0;
+ int param_len = 0;
+ uint16 setup = op;
+ pstring param;
+ char *rparam=NULL, *rdata=NULL;
+
+ param_len = 6;
+ SSVAL(param, 0, level);
+ SSVAL(param, 2, level);
+ SSVAL(param, 4, level);
+
+ if (!cli_send_trans(cli, SMBtrans2,
+ NULL, /* name */
+ -1, 0, /* fid, flags */
+ &setup, 1, 0, /* setup, length, max */
+ param, param_len, 2, /* param, length, max */
+ NULL, data_len, cli->max_xmit /* data, length, max */
+ )) {
+ return False;
+ }
+
+ if (!cli_receive_trans(cli, SMBtrans2,
+ &rparam, &param_len,
+ &rdata, &data_len)) {
+ printf("recv failed op=%d level=%d %s\n", op, level, cli_errstr(cli));
+ return False;
+ }
+
+ if (rdata) free(rdata);
+ if (rparam) free(rparam);
+ return True;
+}
+
+
+static BOOL run_trans2_scan(int dummy)
+{
+ static struct cli_state cli;
+ int op, level;
+
+ printf("starting trans2 scan test\n");
+
+ if (!open_connection(&cli)) {
+ return False;
+ }
+
+ for (op=1; op<200; op++) {
+ for (level = 1; level < 300; level++) {
+ scan_trans2(&cli, op, level);
+ }
+ }
+
+ close_connection(&cli);
+
+ printf("trans2 scan finished\n");
+ return True;
+}
+
+
+
/*
This checks new W2K calls.
*/
@@ -3162,6 +3227,7 @@ static struct {
{"OPEN", run_opentest, 0},
{"DELETE", run_deletetest, 0},
{"W2K", run_w2ktest, 0},
+ {"TRANS2SCAN", run_trans2_scan, 0},
{NULL, NULL, 0}};