From: Matthias Dieter Wallnöfer Date: Mon, 9 Aug 2010 17:52:00 +0000 (+0200) Subject: s4:dsdb/common/util.c - provide a call which returns the forest function level X-Git-Tag: release-4-0-0alpha13~1364 X-Git-Url: http://git.samba.org/?p=amitay%2Fsamba.git;a=commitdiff_plain;h=303089f5b8ced9fb80ed76cb0205f0cdf11fc530 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). --- diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 685c94a411b..7c5fd8a1b48 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) { @@ -2979,6 +2978,20 @@ int dsdb_functional_level(struct ldb_context *ldb) return *domainFunctionality; } +/* + * 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 */