mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +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:
parent
89cc31f5cf
commit
8a40669309
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user