summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-12-10 12:25:55 +0000
committerStefan Metzmacher <metze@samba.org>2014-12-19 13:15:12 +0100
commit8a4066930908e82ac593f616ebea67044ff267bb (patch)
tree2ff5dd59adcfafa598bcb7cffa34d7ac0c30c4bf
parent89cc31f5cf9181f04f3ca1a5f7000ee15a74e86e (diff)
downloadsamba-8a4066930908e82ac593f616ebea67044ff267bb.tar.gz
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>
-rw-r--r--source3/winbindd/winbindd_ping_dc.c22
1 files changed, 22 insertions, 0 deletions
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);
}