if (schema && do_attribute_explicit(attrs, "dsSchemaPrefixCount")) {
if (ldb_msg_add_fmt(msg, "dsSchemaPrefixCount",
- "%u", schema->num_prefixes) != 0) {
+ "%u", schema->prefixmap->length) != 0) {
goto failed;
}
}
}
}
- if (priv && do_attribute(attrs, "domainFunctionality")
- && (val = talloc_get_type(ldb_get_opaque(ldb, "domainFunctionality"), int))) {
+ if (priv && do_attribute(attrs, "domainFunctionality")) {
if (ldb_msg_add_fmt(msg, "domainFunctionality",
- "%d", *val) != 0) {
+ "%d", dsdb_functional_level(ldb)) != 0) {
goto failed;
}
}
}
}
+ if (do_attribute(attrs, "isGlobalCatalogReady")) {
+ /* MS-ADTS 3.1.1.3.2.10
+ Note, we should only return true here is we have
+ completed at least one synchronisation. As both
+ provision and vampire do a full sync, this means we
+ can return true is the gc bit is set in the NTDSDSA
+ options */
+ if (ldb_msg_add_fmt(msg, "isGlobalCatalogReady",
+ "%s", samdb_is_gc(ldb)?"TRUE":"FALSE") != 0) {
+ goto failed;
+ }
+ }
/* TODO: lots more dynamic attributes should be added here */
}
talloc_free(ext_res);
- return ldb_request_done(req, ret);
+ return ldb_module_done(req, NULL, NULL, ret);
}
_PUBLIC_ const struct ldb_module_ops ldb_rootdse_module_ops = {
- .name = "rootdse",
+ .name = "rootdse",
.init_context = rootdse_init,
.search = rootdse_search,
- .request = rootdse_request,
+ .request = rootdse_request,
.modify = rootdse_modify
};