Author: abartlet Date: 2006-01-12 03:30:20 +0000 (Thu, 12 Jan 2006) New Revision: 12861
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12861 Log: Cope when we are not supplied the messaging context. This is just another case where we have to fallback to the node status request. Andrew Bartlett Modified: branches/SAMBA_4_0/source/libcli/finddcs.c branches/SAMBA_4_0/source/libnet/libnet_lookup.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/finddcs.c =================================================================== --- branches/SAMBA_4_0/source/libcli/finddcs.c 2006-01-12 03:07:04 UTC (rev 12860) +++ branches/SAMBA_4_0/source/libcli/finddcs.c 2006-01-12 03:30:20 UTC (rev 12861) @@ -131,9 +131,15 @@ state->dcs[0].address = talloc_steal(state->dcs, address); - /* Try and find the nbt server. We are not going to fail if - * we can't get the name, it will just be a disapointment. - * The nbt server just might not be running */ + /* Try and find the nbt server. Fallback to a node status + * request if we can't make this happen The nbt server just + * might not be running, or we may not have a messaging + * context (not root etc) */ + if (!state->msg_ctx) { + fallback_node_status(state); + return; + } + nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server"); if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) { fallback_node_status(state); Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet_lookup.c 2006-01-12 03:07:04 UTC (rev 12860) +++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c 2006-01-12 03:30:20 UTC (rev 12861) @@ -169,9 +169,6 @@ { struct messaging_context *msg_ctx = messaging_init(mem_ctx, random() % 0x10000000, ctx->event_ctx); struct composite_context *c; - if (!msg_ctx) { - return NULL; - } c = finddcs_send(mem_ctx, io->in.domain_name, NBT_NAME_PDC,
