wb-ndr: use WINBIND_TRUST_LEVEL_COMPAT_LIST instead of WINBINDD_LIST_TRUSTDOM
[metze/samba/wb-ndr.git] / source / winbindd / winbindd_misc.c
index f5757823a65104070778ba3cd7b8572d57637880..4e4154adc593e0662aa26a88bed9077c8b7acebe 100644 (file)
@@ -224,78 +224,6 @@ done:
        TALLOC_FREE( extra_data );      
 }
 
-enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
-                                                       struct winbindd_cli_state *state)
-{
-       uint32 i, num_domains;
-       char **names, **alt_names;
-       DOM_SID *sids;
-       int extra_data_len = 0;
-       char *extra_data;
-       NTSTATUS result;
-       bool have_own_domain = False;
-
-       DEBUG(3, ("[%5lu]: list trusted domains\n",
-                 (unsigned long)state->pid));
-
-       result = domain->methods->trusted_domains(domain, state->mem_ctx,
-                                                 &num_domains, &names,
-                                                 &alt_names, &sids);
-
-       if (!NT_STATUS_IS_OK(result)) {
-               DEBUG(3, ("winbindd_dual_list_trusted_domains: trusted_domains returned %s\n",
-                       nt_errstr(result) ));
-               return WINBINDD_ERROR;
-       }
-
-       extra_data = talloc_strdup(state->mem_ctx, "");
-
-       if (num_domains > 0)
-               extra_data = talloc_asprintf(
-                       state->mem_ctx, "%s\\%s\\%s",
-                       names[0], alt_names[0] ? alt_names[0] : names[0],
-                       sid_string_talloc(state->mem_ctx, &sids[0]));
-
-       for (i=1; i<num_domains; i++)
-               extra_data = talloc_asprintf(
-                       state->mem_ctx, "%s\n%s\\%s\\%s",
-                       extra_data, names[i],
-                       alt_names[i] ? alt_names[i] : names[i],
-                       sid_string_talloc(state->mem_ctx, &sids[i]));
-
-       /* add our primary domain */
-       
-       for (i=0; i<num_domains; i++) {
-               if (strequal(names[i], domain->name)) {
-                       have_own_domain = True;
-                       break;
-               }
-       }
-
-       if (state->request.data.list_all_domains && !have_own_domain) {
-               extra_data = talloc_asprintf(
-                       state->mem_ctx, "%s\n%s\\%s\\%s",
-                       extra_data, domain->name,
-                       domain->alt_name ? domain->alt_name : domain->name,
-                       sid_string_talloc(state->mem_ctx, &domain->sid));
-       }
-
-       /* This is a bit excessive, but the extra data sooner or later will be
-          talloc'ed */
-
-       extra_data_len = 0;
-       if (extra_data != NULL) {
-               extra_data_len = strlen(extra_data);
-       }
-
-       if (extra_data_len > 0) {
-               state->response.extra_data.data = SMB_STRDUP(extra_data);
-               state->response.length += extra_data_len+1;
-       }
-
-       return WINBINDD_OK;
-}
-
 static void ndr_child_trust_compat_list(struct winbindd_domain *domain,
                                        struct winbindd_cli_state *state,
                                        struct winbind_trust *r)