summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-09 19:52:00 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-10 19:08:56 +0200
commit303089f5b8ced9fb80ed76cb0205f0cdf11fc530 (patch)
treecc6bdba44f2a98be00b965119b919ef61fe5dabf
parent3b1d74f4b677842a0cbe16ba29be7d672c07b87c (diff)
downloadsamba-303089f5b8ced9fb80ed76cb0205f0cdf11fc530.tar.gz
samba-303089f5b8ced9fb80ed76cb0205f0cdf11fc530.tar.bz2
samba-303089f5b8ced9fb80ed76cb0205f0cdf11fc530.zip
s4:dsdb/common/util.c - provide a call which returns the forest function level
Sooner or later we'll need this too since not all operations depend only on the current's domain function level (see the MS-ADTS docs).
-rw-r--r--source4/dsdb/common/util.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 685c94a411..7c5fd8a1b4 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -2965,8 +2965,7 @@ const char *samdb_cn_to_lDAPDisplayName(TALLOC_CTX *mem_ctx, const char *cn)
}
/*
- return domain functional level
- returns DS_DOMAIN_FUNCTION_*
+ * This detects and returns the domain functional level (DS_DOMAIN_FUNCTION_*)
*/
int dsdb_functional_level(struct ldb_context *ldb)
{
@@ -2980,6 +2979,20 @@ int dsdb_functional_level(struct ldb_context *ldb)
}
/*
+ * This detects and returns the forest functional level (DS_DOMAIN_FUNCTION_*)
+ */
+int dsdb_forest_functional_level(struct ldb_context *ldb)
+{
+ int *forestFunctionality =
+ talloc_get_type(ldb_get_opaque(ldb, "forestFunctionality"), int);
+ if (!forestFunctionality) {
+ DEBUG(0,(__location__ ": WARNING: forestFunctionality not setup\n"));
+ return DS_DOMAIN_FUNCTION_2000;
+ }
+ return *forestFunctionality;
+}
+
+/*
set a GUID in an extended DN structure
*/
int dsdb_set_extended_dn_guid(struct ldb_dn *dn, const struct GUID *guid, const char *component_name)