From: Stefan Metzmacher Date: Wed, 10 Dec 2014 12:25:55 +0000 (+0000) Subject: s3:winbindd: report our own name for PING_DC and internal domains X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba%2Fsamba-obnox.git;a=commitdiff_plain;h=8a4066930908e82ac593f616ebea67044ff267bb s3:winbindd: report our own name for PING_DC and internal domains This means "wbinfo --ping-dc" works fine on a DC. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison Reviewed-by: Andrew Bartlett --- diff --git a/source3/winbindd/winbindd_ping_dc.c b/source3/winbindd/winbindd_ping_dc.c index 0a767d9e12d..b5a697779bc 100644 --- a/source3/winbindd/winbindd_ping_dc.c +++ b/source3/winbindd/winbindd_ping_dc.c @@ -54,10 +54,32 @@ struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } if (domain->internal) { + const char *d = lp_dnsdomain(); + const char *n = lp_netbios_name(); + /* * Internal domains are passdb based, we can always * contact them. */ + + if (d != NULL) { + char *h; + h = strlower_talloc(mem_ctx, n); + if (tevent_req_nomem(h, req)) { + return tevent_req_post(req, ev); + } + + state->dcname = talloc_asprintf(state, "%s.%s", h, d); + if (tevent_req_nomem(state->dcname, req)) { + return tevent_req_post(req, ev); + } + } else { + state->dcname = talloc_strdup(state, n); + if (tevent_req_nomem(state->dcname, req)) { + return tevent_req_post(req, ev); + } + } + tevent_req_done(req); return tevent_req_post(req, ev); }