diff options
author | Volker Lendecke <vl@samba.org> | 2009-05-16 14:21:39 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-06-14 11:25:47 +0200 |
commit | d61f3626b79e0523beadff355453145aa7b0195c (patch) | |
tree | 6fe283f3aa8a62590b24f1eb87924e8b8e2c27f0 /source3 | |
parent | 225b14cf24ec1349fd79a20ec3464ea64a368a39 (diff) | |
download | samba-d61f3626b79e0523beadff355453145aa7b0195c.tar.gz samba-d61f3626b79e0523beadff355453145aa7b0195c.tar.bz2 samba-d61f3626b79e0523beadff355453145aa7b0195c.zip |
Remove unused init_child_connection()
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/winbindd_proto.h | 4 | ||||
-rw-r--r-- | source3/winbindd/winbindd_util.c | 135 |
2 files changed, 0 insertions, 139 deletions
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 9bc8f0b032..ac0f71e148 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -507,10 +507,6 @@ void winbindd_list_users(struct winbindd_cli_state *state); struct winbindd_domain *domain_list(void); void free_domain_list(void); void rescan_trusted_domains( void ); -enum winbindd_result init_child_connection(struct winbindd_domain *domain, - void (*continuation)(void *private_data, - bool success), - void *private_data); enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain, struct winbindd_cli_state *state); bool init_domain_list(void); diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index bdd73e2dec..7aceca39c4 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -567,141 +567,6 @@ void rescan_trusted_domains( void ) return; } -struct init_child_state { - TALLOC_CTX *mem_ctx; - struct winbindd_domain *domain; - struct winbindd_request *request; - struct winbindd_response *response; - void (*continuation)(void *private_data, bool success); - void *private_data; -}; - -static void init_child_recv(void *private_data, bool success); -static void init_child_getdc_recv(void *private_data, bool success); - -enum winbindd_result init_child_connection(struct winbindd_domain *domain, - void (*continuation)(void *private_data, - bool success), - void *private_data) -{ - TALLOC_CTX *mem_ctx; - struct winbindd_request *request; - struct winbindd_response *response; - struct init_child_state *state; - struct winbindd_domain *request_domain; - - mem_ctx = talloc_init("init_child_connection"); - if (mem_ctx == NULL) { - DEBUG(0, ("talloc_init failed\n")); - return WINBINDD_ERROR; - } - - request = TALLOC_ZERO_P(mem_ctx, struct winbindd_request); - response = TALLOC_P(mem_ctx, struct winbindd_response); - state = TALLOC_P(mem_ctx, struct init_child_state); - - if ((request == NULL) || (response == NULL) || (state == NULL)) { - DEBUG(0, ("talloc failed\n")); - TALLOC_FREE(mem_ctx); - continuation(private_data, False); - return WINBINDD_ERROR; - } - - request->length = sizeof(*request); - - state->mem_ctx = mem_ctx; - state->domain = domain; - state->request = request; - state->response = response; - state->continuation = continuation; - state->private_data = private_data; - - if (IS_DC || domain->primary || domain->internal ) { - /* The primary domain has to find the DC name itself */ - request->cmd = WINBINDD_INIT_CONNECTION; - fstrcpy(request->domain_name, domain->name); - request->data.init_conn.is_primary = domain->primary ? true : false; - fstrcpy(request->data.init_conn.dcname, ""); - async_request(mem_ctx, &domain->child, request, response, - init_child_recv, state); - return WINBINDD_PENDING; - } - - /* This is *not* the primary domain, let's ask our DC about a DC - * name */ - - request->cmd = WINBINDD_GETDCNAME; - fstrcpy(request->domain_name, domain->name); - - request_domain = find_our_domain(); - async_domain_request(mem_ctx, request_domain, request, response, - init_child_getdc_recv, state); - return WINBINDD_PENDING; -} - -static void init_child_getdc_recv(void *private_data, bool success) -{ - struct init_child_state *state = - talloc_get_type_abort(private_data, struct init_child_state); - const char *dcname = ""; - - DEBUG(10, ("Received getdcname response\n")); - - if (success && (state->response->result == WINBINDD_OK)) { - dcname = state->response->data.dc_name; - } - - state->request->cmd = WINBINDD_INIT_CONNECTION; - fstrcpy(state->request->domain_name, state->domain->name); - state->request->data.init_conn.is_primary = False; - fstrcpy(state->request->data.init_conn.dcname, dcname); - - async_request(state->mem_ctx, &state->domain->child, - state->request, state->response, - init_child_recv, state); -} - -static void init_child_recv(void *private_data, bool success) -{ - struct init_child_state *state = - talloc_get_type_abort(private_data, struct init_child_state); - - DEBUG(5, ("Received child initialization response for domain %s\n", - state->domain->name)); - - if ((!success) || (state->response->result != WINBINDD_OK)) { - DEBUG(3, ("Could not init child\n")); - state->continuation(state->private_data, False); - talloc_destroy(state->mem_ctx); - return; - } - - fstrcpy(state->domain->name, - state->response->data.domain_info.name); - fstrcpy(state->domain->alt_name, - state->response->data.domain_info.alt_name); - if (!string_to_sid(&state->domain->sid, - state->response->data.domain_info.sid)) { - DEBUG(1,("init_child_recv: Could not convert sid %s " - "from string\n", - state->response->data.domain_info.sid)); - state->continuation(state->private_data, False); - talloc_destroy(state->mem_ctx); - return; - } - - state->domain->native_mode = - state->response->data.domain_info.native_mode; - state->domain->active_directory = - state->response->data.domain_info.active_directory; - - init_dc_connection(state->domain); - - if (state->continuation != NULL) - state->continuation(state->private_data, True); - talloc_destroy(state->mem_ctx); -} - enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain, struct winbindd_cli_state *state) { |