pass ndr requests via sendto_child()/sendto_domain() too
authorStefan Metzmacher <metze@sernet.de>
Thu, 6 Sep 2007 16:07:19 +0000 (18:07 +0200)
committerStefan Metzmacher <metze@sernet.de>
Thu, 11 Oct 2007 15:21:46 +0000 (17:21 +0200)
metze

source/winbindd/winbindd_dual.c

index c3ad11d..dad9d3c 100644 (file)
@@ -651,19 +651,42 @@ static void recvfrom_child_old(void *private_data_data, BOOL success)
        request_ok(state);
 }
 
+static void recvfrom_child_ndr(void *private_data_data, BOOL success)
+{
+       struct winbindd_cli_state *state =
+               talloc_get_type_abort(private_data_data, struct winbindd_cli_state);
+
+       if (!success) {
+               winbindd_reply_ndr_error(state, WINBIND_STATUS_UNKNOWN_ERROR);
+               return;
+       }
+
+       winbindd_reply_ndr_error(state, state->c.ndr.result);
+}
+
 void sendto_child(struct winbindd_cli_state *state,
                  struct winbindd_child *child)
 {
-       async_request(state->mem_ctx, child, &state->request,
-                     &state->response, recvfrom_child, state);
+       if (state->is_ndr) {
+               async_ndr_call(state->mem_ctx, child, &state->c,
+                              recvfrom_child_ndr, state);
+       } else {
+               async_request(state->mem_ctx, child, &state->request,
+                             &state->response, recvfrom_child_old, state);
+       }
 }
 
 void sendto_domain(struct winbindd_cli_state *state,
                   struct winbindd_domain *domain)
 {
-       async_domain_request(state->mem_ctx, domain,
-                            &state->request, &state->response,
-                            recvfrom_child, state);
+       if (state->is_ndr) {
+               async_ndr_domain_call(state->mem_ctx, domain, &state->c,
+                                     recvfrom_child_ndr, state);
+       } else {
+               async_domain_request(state->mem_ctx, domain,
+                                    &state->request, &state->response,
+                                    recvfrom_child_old, state);
+       }
 }
 
 const struct winbindd_child_dispatch_table domain_dispatch_table[] = {