From 4b3d329ca21e731729af0a305386bee5d748ae92 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 22:23:18 +0000 Subject: - added a raw smb scanner - its not a root_fid in ntrename (This used to be commit 74be55efdc77d4ba7e70d0554cbd72472522abff) --- source4/torture/scanner.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'source4/torture/scanner.c') diff --git a/source4/torture/scanner.c b/source4/torture/scanner.c index 0a92db9a4b..955ae7a274 100644 --- a/source4/torture/scanner.c +++ b/source4/torture/scanner.c @@ -512,3 +512,52 @@ BOOL torture_nttrans_scan(int dummy) printf("nttrans scan finished\n"); return True; } + + +/* scan for valid base SMB requests */ +BOOL torture_smb_scan(int dummy) +{ + static struct cli_state *cli; + int op; + struct cli_request *req; + NTSTATUS status; + + for (op=0x0;op<=0xFF;op++) { + if (op == SMBreadbraw) continue; + + if (!torture_open_connection(&cli)) { + return False; + } + + req = cli_request_setup(cli->tree, op, 0, 0); + + if (!cli_request_send(req)) { + cli_request_destroy(req); + break; + } + + usleep(10000); + if (cli_transport_pending(cli->transport)) { + status = cli_request_simple_recv(req); + printf("op=0x%x status=%s\n", op, nt_errstr(status)); + torture_close_connection(cli); + continue; + } + + sleep(1); + if (cli_transport_pending(cli->transport)) { + status = cli_request_simple_recv(req); + printf("op=0x%x status=%s\n", op, nt_errstr(status)); + } else { + printf("op=0x%x no reply\n", op); + cli_request_destroy(req); + continue; /* don't attempt close! */ + } + + torture_close_connection(cli); + } + + + printf("smb scan finished\n"); + return True; +} -- cgit