diff options
author | Volker Lendecke <vl@samba.org> | 2009-08-15 13:23:57 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-08-16 10:38:24 +0200 |
commit | 0f64bb5b7ef9b77b1865a5b6e0bdab331a618c38 (patch) | |
tree | e90284ab1efa11cca660fe652b7ebfe3b7823150 /source3/winbindd/winbindd_misc.c | |
parent | e54503e82fdbb337b4de9c5aaef252edb2e11e39 (diff) | |
download | samba-0f64bb5b7ef9b77b1865a5b6e0bdab331a618c38.tar.gz samba-0f64bb5b7ef9b77b1865a5b6e0bdab331a618c38.tar.bz2 samba-0f64bb5b7ef9b77b1865a5b6e0bdab331a618c38.zip |
s3:winbind: Convert winbindd_show_sequence to the new API
Diffstat (limited to 'source3/winbindd/winbindd_misc.c')
-rw-r--r-- | source3/winbindd/winbindd_misc.c | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index c6608316d1..7b10911434 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -506,117 +506,6 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain, return WINBINDD_OK; } -struct sequence_state { - TALLOC_CTX *mem_ctx; - struct winbindd_cli_state *cli_state; - struct winbindd_domain *domain; - struct winbindd_request *request; - struct winbindd_response *response; - char *extra_data; -}; - -static void sequence_recv(void *private_data, bool success); - -void winbindd_show_sequence(struct winbindd_cli_state *state) -{ - struct sequence_state *seq; - - /* Ensure null termination */ - state->request->domain_name[sizeof(state->request->domain_name)-1]='\0'; - - if (strlen(state->request->domain_name) > 0) { - struct winbindd_domain *domain; - domain = find_domain_from_name_noinit( - state->request->domain_name); - if (domain == NULL) { - request_error(state); - return; - } - sendto_domain(state, domain); - return; - } - - /* Ask all domains in sequence, collect the results in sequence_recv */ - - seq = TALLOC_P(state->mem_ctx, struct sequence_state); - if (seq == NULL) { - DEBUG(0, ("talloc failed\n")); - request_error(state); - return; - } - - seq->mem_ctx = state->mem_ctx; - seq->cli_state = state; - seq->domain = domain_list(); - if (seq->domain == NULL) { - DEBUG(0, ("domain list empty\n")); - request_error(state); - return; - } - seq->request = TALLOC_ZERO_P(state->mem_ctx, - struct winbindd_request); - seq->response = TALLOC_ZERO_P(state->mem_ctx, - struct winbindd_response); - seq->extra_data = talloc_strdup(state->mem_ctx, ""); - - if ((seq->request == NULL) || (seq->response == NULL) || - (seq->extra_data == NULL)) { - DEBUG(0, ("talloc failed\n")); - request_error(state); - return; - } - - seq->request->length = sizeof(*seq->request); - seq->request->cmd = WINBINDD_SHOW_SEQUENCE; - fstrcpy(seq->request->domain_name, seq->domain->name); - - async_domain_request(state->mem_ctx, seq->domain, - seq->request, seq->response, - sequence_recv, seq); -} - -static void sequence_recv(void *private_data, bool success) -{ - struct sequence_state *state = - (struct sequence_state *)private_data; - uint32 seq = DOM_SEQUENCE_NONE; - - if ((success) && (state->response->result == WINBINDD_OK)) - seq = state->response->data.sequence_number; - - if (seq == DOM_SEQUENCE_NONE) { - state->extra_data = talloc_asprintf(state->mem_ctx, - "%s%s : DISCONNECTED\n", - state->extra_data, - state->domain->name); - } else { - state->extra_data = talloc_asprintf(state->mem_ctx, - "%s%s : %d\n", - state->extra_data, - state->domain->name, seq); - } - - state->domain->sequence_number = seq; - - state->domain = state->domain->next; - - if (state->domain == NULL) { - struct winbindd_cli_state *cli_state = state->cli_state; - cli_state->response->length = - sizeof(struct winbindd_response) + - strlen(state->extra_data) + 1; - cli_state->response->extra_data.data = state->extra_data; - request_ok(cli_state); - return; - } - - /* Ask the next domain */ - fstrcpy(state->request->domain_name, state->domain->name); - async_domain_request(state->mem_ctx, state->domain, - state->request, state->response, - sequence_recv, state); -} - /* This is the child-only version of --sequence. It only allows for a single * domain (ie "our" one) to be displayed. */ |