summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-01-04 21:24:17 +0100
committerStefan Metzmacher <metze@samba.org>2011-01-04 21:28:56 +0100
commit6dd5ccd04130a7d33bebca1a2340d339ab7b34c9 (patch)
tree1cc62df57833a6c959ffad5b412da36fc4a336fe /source3/rpcclient
parent697d4ea8fff6fbc48aa59b17fa0ecc91bf1d233d (diff)
downloadsamba-6dd5ccd04130a7d33bebca1a2340d339ab7b34c9.tar.gz
samba-6dd5ccd04130a7d33bebca1a2340d339ab7b34c9.tar.bz2
samba-6dd5ccd04130a7d33bebca1a2340d339ab7b34c9.zip
s3:rpcclient: improve "epmmap" output
metze
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_epmapper.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/source3/rpcclient/cmd_epmapper.c b/source3/rpcclient/cmd_epmapper.c
index 2c830e2d35..7ddd0bc5dd 100644
--- a/source3/rpcclient/cmd_epmapper.c
+++ b/source3/rpcclient/cmd_epmapper.c
@@ -30,14 +30,14 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
struct dcerpc_binding_handle *b = p->binding_handle;
struct dcerpc_binding map_binding;
struct epm_twr_t map_tower;
- struct epm_twr_t res_tower;
- struct epm_twr_p_t towers;
+ struct epm_twr_p_t towers[500];
struct policy_handle entry_handle;
struct ndr_syntax_id abstract_syntax;
uint32_t num_towers;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
NTSTATUS status;
uint32_t result;
+ uint32_t i;
abstract_syntax = ndr_table_lsarpc.syntax_id;
@@ -54,13 +54,13 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
return status;
}
- towers.twr = &res_tower;
-
+ ZERO_STRUCT(towers);
ZERO_STRUCT(entry_handle);
+
status = dcerpc_epm_Map(
b, tmp_ctx, &abstract_syntax.uuid,
- &map_tower, &entry_handle, 1,
- &num_towers, &towers, &result);
+ &map_tower, &entry_handle, ARRAY_SIZE(towers),
+ &num_towers, towers, &result);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "dcerpc_epm_Map returned %s\n",
nt_errstr(status));
@@ -73,6 +73,25 @@ static NTSTATUS cmd_epmapper_map(struct rpc_pipe_client *p,
return NT_STATUS_UNSUCCESSFUL;
}
+ d_printf("num_tower[%u]\n", num_towers);
+
+ for (i=0; i < num_towers; i++) {
+ struct dcerpc_binding *binding;
+
+ if (towers[i].twr == NULL) {
+ d_fprintf(stderr, "tower[%u] NULL\n", i);
+ break;
+ }
+
+ status = dcerpc_binding_from_tower(tmp_ctx, &towers[i].twr->tower,
+ &binding);
+ if (!NT_STATUS_IS_OK(status)) {
+ break;
+ }
+
+ d_printf("tower[%u] %s\n", i, dcerpc_binding_string(tmp_ctx, binding));
+ }
+
return NT_STATUS_OK;
}