summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-12-22 12:19:46 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-12-22 12:29:14 +0200
commit9aaacee6cd19adf615f941771fe9d490b7dae3c4 (patch)
tree0e95a8e2df6031766c7b62005369722e82978eba /source4/dsdb/common
parent2c657d87057b13533c7cd9b1dd695aa889e4a991 (diff)
downloadsamba-9aaacee6cd19adf615f941771fe9d490b7dae3c4.tar.gz
samba-9aaacee6cd19adf615f941771fe9d490b7dae3c4.tar.bz2
samba-9aaacee6cd19adf615f941771fe9d490b7dae3c4.zip
s4-dsdb: Added a helper function to get the default dns domain as string.
Diffstat (limited to 'source4/dsdb/common')
-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 36f69337a6..b2d4be0068 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3952,6 +3952,25 @@ const char *samdb_forest_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
return forest_name;
}
+/* returns back the default domain DNS name */
+const char *samdb_default_domain_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
+{
+ const char *domain_name = ldb_dn_canonical_string(mem_ctx,
+ ldb_get_default_basedn(ldb));
+ char *p;
+
+ if (domain_name == NULL) {
+ return NULL;
+ }
+
+ p = strchr(domain_name, '/');
+ if (p) {
+ *p = '\0';
+ }
+
+ return domain_name;
+}
+
/*
validate that an DSA GUID belongs to the specified user sid.
The user SID must be a domain controller account (either RODC or