summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/finddcs.c12
-rw-r--r--source4/libnet/libnet_lookup.c3
2 files changed, 9 insertions, 6 deletions
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index ff4b255a13..036b937f69 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -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);
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 1c1604f407..3b2060fdd2 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -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,