summaryrefslogtreecommitdiff
path: root/source4/dsdb/common/util.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-04-12 14:15:34 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-04-13 09:32:33 +0200
commit719a46913bed65932ebe696f441bd88ebd54819c (patch)
tree97b7c1f43e3df220478e2501ee83a438a64a8e02 /source4/dsdb/common/util.c
parent5fc2801c09cdfe74253b52b9bf93d7ecad1a98cf (diff)
downloadsamba-719a46913bed65932ebe696f441bd88ebd54819c.tar.gz
samba-719a46913bed65932ebe696f441bd88ebd54819c.tar.bz2
samba-719a46913bed65932ebe696f441bd88ebd54819c.zip
s4:dsdb/common/util.c - add a call which determines centrally the forest DNS domainname
Diffstat (limited to 'source4/dsdb/common/util.c')
-rw-r--r--source4/dsdb/common/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 5625e95096..d36e1ec1bb 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3473,3 +3473,22 @@ int dsdb_search_one(struct ldb_context *ldb,
return LDB_SUCCESS;
}
+
+/* returns back the forest DNS name */
+const char *samdb_forest_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
+{
+ const char *forest_name = ldb_dn_canonical_string(mem_ctx,
+ ldb_get_root_basedn(ldb));
+ char *p;
+
+ if (forest_name == NULL) {
+ return NULL;
+ }
+
+ p = strchr(forest_name, '/');
+ if (p) {
+ *p = '\0';
+ }
+
+ return forest_name;
+}