dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper function
authorStefan Metzmacher <metze@samba.org>
Thu, 1 Feb 2018 22:09:26 +0000 (23:09 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 4 Sep 2018 00:31:26 +0000 (02:31 +0200)
This is similar to dsdb_trust_xref_tdo_info(), but will also work
if we ever support more than one domain in our forest.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/common/util_trusts.c

index 154dd947212a959687d425f36e1f6bd278754e47..40777ec14ff75b9100517fd90c29ec9f601397a3 100644 (file)
@@ -828,6 +828,22 @@ static bool dsdb_trust_find_tln_ex_match(const struct lsa_ForestTrustInformation
        return false;
 }
 
+NTSTATUS dsdb_trust_local_tdo_info(TALLOC_CTX *mem_ctx,
+                                  struct ldb_context *sam_ctx,
+                                  struct lsa_TrustDomainInfoInfoEx **_tdo)
+{
+       struct ldb_dn *domain_dn = NULL;
+
+       domain_dn = ldb_get_default_basedn(sam_ctx);
+       if (domain_dn == NULL) {
+               return NT_STATUS_INTERNAL_ERROR;
+       }
+
+       return dsdb_trust_crossref_tdo_info(mem_ctx, sam_ctx,
+                                           domain_dn, NULL,
+                                           _tdo, NULL, NULL);
+}
+
 NTSTATUS dsdb_trust_xref_tdo_info(TALLOC_CTX *mem_ctx,
                                  struct ldb_context *sam_ctx,
                                  struct lsa_TrustDomainInfoInfoEx **_tdo)