1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-12-10 12:25:55 +00:00
parent 89cc31f5cf
commit 8a40669309

View File

@ -54,10 +54,32 @@ struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev); return tevent_req_post(req, ev);
} }
if (domain->internal) { if (domain->internal) {
const char *d = lp_dnsdomain();
const char *n = lp_netbios_name();
/* /*
* Internal domains are passdb based, we can always * Internal domains are passdb based, we can always
* contact them. * 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); tevent_req_done(req);
return tevent_req_post(req, ev); return tevent_req_post(req, ev);
} }