r12861: Cope when we are not supplied the messaging context. This is just
authorAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jan 2006 03:30:20 +0000 (03:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:50:54 +0000 (13:50 -0500)
another case where we have to fallback to the node status request.

Andrew Bartlett

source/libcli/finddcs.c
source/libnet/libnet_lookup.c

index ff4b255a130be72aeb4ae9ab7afcb2286e748036..036b937f69c55faf17a8a5a07813322eb6208f32 100644 (file)
@@ -131,9 +131,15 @@ static void finddcs_name_resolved(struct composite_context *ctx)
 
        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);
index 1c1604f407c030d2ab772a5a473394ae7bda80ab..3b2060fdd2812650181c05f8c19b0fb26fb76282 100644 (file)
@@ -169,9 +169,6 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
 {
        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,