diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-08-13 22:23:18 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-08-13 22:23:18 +0000 |
commit | 4b3d329ca21e731729af0a305386bee5d748ae92 (patch) | |
tree | 8a8a63dfb52dedd131e750b6fd81543913c741f2 /source4/torture/scanner.c | |
parent | a33f57077686a096917c7e7433852d320a593348 (diff) | |
download | samba-4b3d329ca21e731729af0a305386bee5d748ae92.tar.gz samba-4b3d329ca21e731729af0a305386bee5d748ae92.tar.xz samba-4b3d329ca21e731729af0a305386bee5d748ae92.zip |
- added a raw smb scanner
- its not a root_fid in ntrename
(This used to be commit 74be55efdc77d4ba7e70d0554cbd72472522abff)
Diffstat (limited to 'source4/torture/scanner.c')
-rw-r--r-- | source4/torture/scanner.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/source4/torture/scanner.c b/source4/torture/scanner.c index 0a92db9a4b8..955ae7a274e 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; +} |