winbindd: remove unused rpc_trusted_domains() helper function
authorStefan Metzmacher <metze@samba.org>
Fri, 1 Dec 2017 08:39:09 +0000 (09:39 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Oct 2019 13:33:03 +0000 (14:33 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_rpc.c
source3/winbindd/winbindd_rpc.h

index 793ebe0df569b3285f099e29dd1fa7d92ac91341..1ce7430c72aa164bd9c153fcbd80e4b537bd6b2f 100644 (file)
@@ -879,110 +879,6 @@ seq_num:
        return status;
 }
 
-/* Get a list of trusted domains */
-NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx,
-                            struct rpc_pipe_client *lsa_pipe,
-                            struct policy_handle *lsa_policy,
-                            uint32_t *pnum_trusts,
-                            struct netr_DomainTrust **ptrusts)
-{
-       struct netr_DomainTrust *array = NULL;
-       uint32_t enum_ctx = 0;
-       uint32_t count = 0;
-       NTSTATUS status, result;
-       struct dcerpc_binding_handle *b = lsa_pipe->binding_handle;
-
-       do {
-               struct lsa_DomainList dom_list;
-               struct lsa_DomainListEx dom_list_ex;
-               bool has_ex = false;
-               uint32_t i;
-
-               /*
-                * We don't run into deadlocks here, cause winbind_off() is
-                * called in the main function.
-                */
-               status = dcerpc_lsa_EnumTrustedDomainsEx(b,
-                                                        mem_ctx,
-                                                        lsa_policy,
-                                                        &enum_ctx,
-                                                        &dom_list_ex,
-                                                        (uint32_t) -1,
-                                                        &result);
-               if (NT_STATUS_IS_OK(status) && !NT_STATUS_IS_ERR(result) &&
-                   dom_list_ex.count > 0) {
-                       count += dom_list_ex.count;
-                       has_ex = true;
-               } else {
-                       status = dcerpc_lsa_EnumTrustDom(b,
-                                                        mem_ctx,
-                                                        lsa_policy,
-                                                        &enum_ctx,
-                                                        &dom_list,
-                                                        (uint32_t) -1,
-                                                        &result);
-                       if (!NT_STATUS_IS_OK(status)) {
-                               return status;
-                       }
-                       if (!NT_STATUS_IS_OK(result)) {
-                               if (!NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) {
-                                       return result;
-                               }
-                       }
-
-                       count += dom_list.count;
-               }
-
-               array = talloc_realloc(mem_ctx,
-                                      array,
-                                      struct netr_DomainTrust,
-                                      count);
-               if (array == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               for (i = 0; i < count; i++) {
-                       struct netr_DomainTrust *trust = &array[i];
-                       struct dom_sid *sid;
-
-                       ZERO_STRUCTP(trust);
-
-                       sid = talloc(array, struct dom_sid);
-                       if (sid == NULL) {
-                               return NT_STATUS_NO_MEMORY;
-                       }
-
-                       if (dom_list_ex.domains[i].sid == NULL) {
-                               DBG_ERR("Trusted domain %s has no SID, "
-                                       "skipping!\n",
-                                       trust->dns_name);
-                               continue;
-                       }
-
-                       if (has_ex) {
-                               trust->netbios_name = talloc_move(array,
-                                                                 &dom_list_ex.domains[i].netbios_name.string);
-                               trust->dns_name = talloc_move(array,
-                                                             &dom_list_ex.domains[i].domain_name.string);
-                               sid_copy(sid, dom_list_ex.domains[i].sid);
-                       } else {
-                               trust->netbios_name = talloc_move(array,
-                                                                 &dom_list.domains[i].name.string);
-                               trust->dns_name = NULL;
-
-                               sid_copy(sid, dom_list.domains[i].sid);
-                       }
-
-                       trust->sid = sid;
-               }
-       } while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
-
-       *pnum_trusts = count;
-       *ptrusts = array;
-
-       return NT_STATUS_OK;
-}
-
 static NTSTATUS rpc_try_lookup_sids3(TALLOC_CTX *mem_ctx,
                                     struct winbindd_domain *domain,
                                     struct rpc_pipe_client *cli,
index a5cfe77f289f71eb0473010a18aa49c8fc2e366b..e92d18b5150e762da4cc9eb2c4ae53bc072c2500 100644 (file)
@@ -116,11 +116,4 @@ NTSTATUS rpc_sequence_number(TALLOC_CTX *mem_ctx,
                             const char *domain_name,
                             uint32_t *pseq);
 
-/* Get a list of trusted domains */
-NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx,
-                            struct rpc_pipe_client *lsa_pipe,
-                            struct policy_handle *lsa_policy,
-                            uint32_t *pnum_trusts,
-                            struct netr_DomainTrust **ptrusts);
-
 #endif /* _WINBINDD_RPC_H_ */