From 8faa77f177833eeee245391840d06771f46e0136 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 04:46:50 +0000 Subject: rpcdump.exe now works fine against a Samba4 server for some reason the epm_Lookup replies can't be parsed by ethereal, although w2k parses then fine as does the Samba4 NDR code. (This used to be commit 097e7ca99d947932df5674c36e628ca6b8f31d3a) --- source4/rpc_server/dcerpc_server.c | 1 + source4/rpc_server/dcerpc_server.h | 1 + source4/rpc_server/epmapper/rpc_epmapper.c | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 35661d913e..67b36cdc48 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -651,6 +651,7 @@ int dcesrv_lookup_endpoints(const struct dcerpc_interface_table *table, return -1; } + (*e)->name = table->name; (*e)->uuid = table->uuid; (*e)->if_version = table->if_version; (*e)->endpoint.type = ENDPOINT_SMB; diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 3f2f5d039f..83e0ee249a 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -35,6 +35,7 @@ struct dcesrv_endpoint { /* a endpoint combined with an interface description */ struct dcesrv_ep_iface { + const char *name; struct dcesrv_endpoint endpoint; const char *uuid; uint32 if_version; diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c index c5bd2ffa45..2898a70159 100644 --- a/source4/rpc_server/epmapper/rpc_epmapper.c +++ b/source4/rpc_server/epmapper/rpc_epmapper.c @@ -72,14 +72,14 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[3].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\PIPE\\%s", e->endpoint.info.smb_pipe); - twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data); + twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data)+1; /* on an NetBIOS link ... */ twr->floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS; twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[4].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name()); - twr->floors[4].rhs.rhs_data.length = strlen(twr->floors[4].rhs.rhs_data.data); + twr->floors[4].rhs.rhs_data.length = strlen(twr->floors[4].rhs.rhs_data.data)+1; return True; } @@ -175,6 +175,9 @@ static NTSTATUS epm_Lookup(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, if (num_ents == 0) { r->out.entries = NULL; + r->out.status = EPMAPPER_STATUS_NO_MORE_ENTRIES; + ZERO_STRUCTP(r->out.entry_handle); + dcesrv_handle_destroy(dce, h); return NT_STATUS_OK; } @@ -185,7 +188,7 @@ static NTSTATUS epm_Lookup(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, for (i=0;iout.entries[i].object); - r->out.entries[i].annotation = ""; + r->out.entries[i].annotation = eps->e[i].name; r->out.entries[i].tower = talloc_p(mem_ctx, struct epm_twr_t); if (!r->out.entries[i].tower) { return NT_STATUS_NO_MEMORY; @@ -270,7 +273,7 @@ static NTSTATUS epm_Map(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, failed: r->out.num_towers = 0; - r->out.status = EPMAPPER_MAP_FAILED; + r->out.status = EPMAPPER_STATUS_NO_MORE_ENTRIES; r->out.towers->twr = NULL; return NT_STATUS_OK; -- cgit