diff options
-rw-r--r-- | source4/dsdb/common/util.c | 17 |
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) |