diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-04-12 14:15:34 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-04-13 09:32:33 +0200 |
commit | 719a46913bed65932ebe696f441bd88ebd54819c (patch) | |
tree | 97b7c1f43e3df220478e2501ee83a438a64a8e02 | |
parent | 5fc2801c09cdfe74253b52b9bf93d7ecad1a98cf (diff) | |
download | samba-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
-rw-r--r-- | source4/dsdb/common/util.c | 19 |
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; +} |