summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-02-02 13:12:36 +0100
committerStefan Metzmacher <metze@samba.org>2015-07-08 18:38:21 +0200
commit46e2a97a2b965745c38a96037fabb655f1f0454e (patch)
tree50dbc77d3752be1b3f9347c4262bdb01d2cd6356 /source4/dsdb/common
parente7c4d2e7ebc51790023b90dc0c4261a85965d73c (diff)
downloadsamba-46e2a97a2b965745c38a96037fabb655f1f0454e.tar.gz
s4:dsdb/common: add dsdb_trust_xref_tdo_info() helper function
This emulates a lsa_TrustDomainInfoInfoEx struct for our own domain. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util_trusts.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/dsdb/common/util_trusts.c b/source4/dsdb/common/util_trusts.c
index 4df82156ba2..eb75cce4460 100644
--- a/source4/dsdb/common/util_trusts.c
+++ b/source4/dsdb/common/util_trusts.c
@@ -833,6 +833,26 @@ static bool dsdb_trust_find_tln_ex_match(const struct lsa_ForestTrustInformation
return false;
}
+NTSTATUS dsdb_trust_xref_tdo_info(TALLOC_CTX *mem_ctx,
+ struct ldb_context *sam_ctx,
+ struct lsa_TrustDomainInfoInfoEx **_tdo)
+{
+ /*
+ * The extra filter makes sure we only find the forest root domain
+ */
+ const char *extra_filter = "(!(|(rootTrust=*)(trustParent=*)))";
+ 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, extra_filter,
+ _tdo, NULL, NULL);
+}
+
static int dsdb_trust_xref_sort_msgs(struct ldb_message **_m1,
struct ldb_message **_m2)
{