s4:rootdse LDB module - make use of "dsdb_forest_functional_level"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 17 Sep 2010 06:49:07 +0000 (08:49 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Sep 2010 23:25:43 +0000 (09:25 +1000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/rootdse.c

index a786a70ce319983a0c2844f0a9b968e907834f2f..c494cf521c9005d27f081c190ee5f41d54e4aa90 100644 (file)
@@ -376,10 +376,9 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms
                }
        }
 
-       if (do_attribute(attrs, "forestFunctionality")
-           && (val = talloc_get_type(ldb_get_opaque(ldb, "forestFunctionality"), int))) {
+       if (do_attribute(attrs, "forestFunctionality")) {
                if (ldb_msg_add_fmt(msg, "forestFunctionality",
-                                   "%d", *val) != LDB_SUCCESS) {
+                                   "%d", dsdb_forest_functional_level(ldb)) != LDB_SUCCESS) {
                        goto failed;
                }
        }