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.
*/
- state->dcname = talloc_strdup(state, domain->dcname);
- if (tevent_req_nomem(state->dcname, req)) {
- return tevent_req_post(req, ev);
+
+ 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);
+ TALLOC_FREE(h);
+
+ 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);
domain->can_do_ncacn_ip_tcp = domain->active_directory;
- if (domain->internal) {
- const char *d = alternative_name;
- const char *n = lp_netbios_name();
-
- /*
- * Internal domains are passdb based, we can always
- * contact them.
- */
-
- if (d != NULL) {
- char *h;
-
- h = strlower_talloc(domain, n);
- if (h == NULL) {
- TALLOC_FREE(domain);
- return NULL;
- }
-
- domain->dcname = talloc_asprintf(domain, "%s.%s", h, d);
- TALLOC_FREE(h);
- if (domain->dcname == NULL) {
- TALLOC_FREE(domain);
- return NULL;
- }
- } else {
- domain->dcname = talloc_strdup(domain, n);
- if (domain->dcname == NULL) {
- TALLOC_FREE(domain);
- return NULL;
- }
- }
- }
-
/* Link to domain list */
DLIST_ADD_END(_domain_list, domain);