From 60d9b40ba4fec876b7288bd51340d6b302af00e3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 4 Feb 2005 01:32:19 +0000 Subject: r5209: Fix the endpoint mapper to work with IPX endpoints (which accidently have the same protocol id as UUID's) Before this, Samba would give NDR errors when contacting a remote server that has IPX support enabled. This one was on my long due bugs list. (This used to be commit 7b847de64f35b8e897b64ad047d8aea3813214f8) --- source4/rpc_server/epmapper/rpc_epmapper.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c index eb9598b6be..8a61fc6428 100644 --- a/source4/rpc_server/epmapper/rpc_epmapper.c +++ b/source4/rpc_server/epmapper/rpc_epmapper.c @@ -187,6 +187,8 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me struct dcesrv_ep_iface *eps; struct epm_floor *floors; enum dcerpc_transport_t transport; + struct GUID ndr_uuid; + uint16_t ndr_version; count = build_ep_list(mem_ctx, dce_call->conn->dce_ctx->endpoint_list, &eps); @@ -208,9 +210,11 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me floors = r->in.map_tower->tower.floors; + dcerpc_floor_get_lhs_data(&r->in.map_tower->tower.floors[1], &ndr_uuid, &ndr_version); + if (floors[1].lhs.protocol != EPM_PROTOCOL_UUID || - guid_cmp(mem_ctx, &floors[1].lhs.info.uuid.uuid, NDR_GUID) != 0 || - floors[1].lhs.info.uuid.version != NDR_GUID_VERSION) { + guid_cmp(mem_ctx, &ndr_uuid, NDR_GUID) != 0 || + ndr_version != NDR_GUID_VERSION) { goto failed; } @@ -226,11 +230,10 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me } for (i=0;iin.map_tower->tower.floors[0].lhs.info.uuid.uuid, - &eps[i].ep.floors[0].lhs.info.uuid.uuid) || - r->in.map_tower->tower.floors[0].lhs.info.uuid.version != - eps[i].ep.floors[0].lhs.info.uuid.version || - transport != dcerpc_transport_by_tower(&eps[i].ep)) { + if ( + !data_blob_equal(&r->in.map_tower->tower.floors[0].lhs.lhs_data, + &eps[i].ep.floors[0].lhs.lhs_data) + || transport != dcerpc_transport_by_tower(&eps[i].ep)) { continue; } -- cgit