From: Stefan Metzmacher Date: Thu, 1 Feb 2018 22:09:26 +0000 (+0100) Subject: dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper function X-Git-Tag: samba-4.7.11~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14a2695de001c58b82618aeec79c7be0b2d956e9;p=thirdparty%2Fsamba.git dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper function 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 Reviewed-by: Andrew Bartlett (cherry picked from commit c1b0ac95db5c6112d90356c7ada8c3d445e9b668) --- diff --git a/source4/dsdb/common/util_trusts.c b/source4/dsdb/common/util_trusts.c index bb34aa1054b..fd3c549ff98 100644 --- a/source4/dsdb/common/util_trusts.c +++ b/source4/dsdb/common/util_trusts.c @@ -827,6 +827,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)