diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-27 05:34:28 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-27 05:34:28 +0000 |
commit | ab3d728b7e7b1f3aa878ed5601a45ba08a08eb1f (patch) | |
tree | fa5e981618d0128676d6954beb5f90fda0c923e6 /source4/torture/rpc/mgmt.c | |
parent | 61bb3c865c4d4324cd2c1ea7d8b337b15dd66493 (diff) | |
download | samba-ab3d728b7e7b1f3aa878ed5601a45ba08a08eb1f.tar.gz samba-ab3d728b7e7b1f3aa878ed5601a45ba08a08eb1f.tar.bz2 samba-ab3d728b7e7b1f3aa878ed5601a45ba08a08eb1f.zip |
added an rpc scanner. This prints messages like this:
uuid 82273fdc-e32a-18c3-3f78-827929dc23ea version 0x0000:0x0000 'eventlog'
24 calls available
WARNING: local IDL defines 4 calls
when all the WARNINGs are gone then we know we have all the calls :)
(This used to be commit f5821b2468a0c46d0e5590de59562926d746c349)
Diffstat (limited to 'source4/torture/rpc/mgmt.c')
-rw-r--r-- | source4/torture/rpc/mgmt.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c index e3a8146e64..0f3cfffa66 100644 --- a/source4/torture/rpc/mgmt.c +++ b/source4/torture/rpc/mgmt.c @@ -22,6 +22,9 @@ #include "includes.h" +/* + ask the server what interface IDs are available on this endpoint +*/ static BOOL test_inq_if_ids(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { @@ -166,11 +169,14 @@ BOOL torture_rpc_mgmt(int dummy) TALLOC_CTX *mem_ctx; BOOL ret = True; int i; + char *host = lp_parm_string(-1, "torture", "host"); + uint32 port; mem_ctx = talloc_init("torture_rpc_mgmt"); - for (i=0;dcerpc_pipes[i];i++) { - + for (i=0;dcerpc_pipes[i];i++) { + char *transport = lp_parm_string(-1, "torture", "transport"); + /* some interfaces are not mappable */ if (dcerpc_pipes[i]->num_calls == 0 || strcmp(dcerpc_pipes[i]->name, "mgmt") == 0) { @@ -179,6 +185,21 @@ BOOL torture_rpc_mgmt(int dummy) printf("\nTesting pipe '%s'\n", dcerpc_pipes[i]->name); + /* on TCP we need to find the right endpoint */ + if (strcasecmp(transport, "ncacn_ip_tcp") == 0) { + status = dcerpc_epm_map_tcp_port(host, + dcerpc_pipes[i]->uuid, + dcerpc_pipes[i]->if_version, + &port); + if (!NT_STATUS_IS_OK(status)) { + ret = False; + continue; + } + + lp_set_cmdline("torture:share", + talloc_asprintf(mem_ctx, "%u", port)); + } + status = torture_rpc_connection(&p, dcerpc_pipes[i]->name, DCERPC_MGMT_UUID, |