|
Lines 78-100
static struct dcerpc_binding *init_domain_binding(struct init_domain_state *stat
Link Here
|
| 78 |
const struct ndr_interface_table *table) |
78 |
const struct ndr_interface_table *table) |
| 79 |
{ |
79 |
{ |
| 80 |
struct dcerpc_binding *binding; |
80 |
struct dcerpc_binding *binding; |
|
|
81 |
char *s; |
| 81 |
NTSTATUS status; |
82 |
NTSTATUS status; |
| 82 |
|
83 |
|
| 83 |
/* Make a binding string */ |
84 |
/* Make a binding string */ |
| 84 |
{ |
85 |
if ((lpcfg_server_role(state->service->task->lp_ctx) != ROLE_DOMAIN_MEMBER) && |
| 85 |
char *s = talloc_asprintf(state, "ncacn_np:%s", state->domain->dc_name); |
86 |
dom_sid_equal(state->domain->info->sid, state->service->primary_sid) && |
|
|
87 |
state->service->sec_channel_type != SEC_CHAN_RODC) { |
| 88 |
s = talloc_asprintf(state, "ncalrpc:%s", state->domain->dc_name); |
| 86 |
if (s == NULL) return NULL; |
89 |
if (s == NULL) return NULL; |
| 87 |
status = dcerpc_parse_binding(state, s, &binding); |
90 |
} else { |
| 88 |
talloc_free(s); |
91 |
s = talloc_asprintf(state, "ncacn_np:%s", state->domain->dc_name); |
| 89 |
if (!NT_STATUS_IS_OK(status)) { |
92 |
if (s == NULL) return NULL; |
| 90 |
return NULL; |
93 |
|
| 91 |
} |
94 |
} |
|
|
95 |
status = dcerpc_parse_binding(state, s, &binding); |
| 96 |
talloc_free(s); |
| 97 |
if (!NT_STATUS_IS_OK(status)) { |
| 98 |
return NULL; |
| 92 |
} |
99 |
} |
| 93 |
|
100 |
|
| 94 |
/* Alter binding to contain hostname, but also address (so we don't look it up twice) */ |
101 |
/* Alter binding to contain hostname, but also address (so we don't look it up twice) */ |
| 95 |
binding->target_hostname = state->domain->dc_name; |
102 |
binding->target_hostname = state->domain->dc_name; |
| 96 |
binding->host = state->domain->dc_address; |
103 |
binding->host = state->domain->dc_address; |
| 97 |
|
104 |
|
|
|
105 |
if (binding->transport == NCALRPC) { |
| 106 |
return binding; |
| 107 |
} |
| 108 |
|
| 98 |
/* This shouldn't make a network call, as the mappings for named pipes are well known */ |
109 |
/* This shouldn't make a network call, as the mappings for named pipes are well known */ |
| 99 |
status = dcerpc_epm_map_binding(binding, binding, table, state->service->task->event_ctx, |
110 |
status = dcerpc_epm_map_binding(binding, binding, table, state->service->task->event_ctx, |
| 100 |
state->service->task->lp_ctx); |
111 |
state->service->task->lp_ctx); |
| 101 |
- |
|
|