if (!schema) {
return NULL;
}
+ schema->refresh_interval = 120;
return schema;
}
}
schema_copy->num_attributes = schema->num_attributes;
+ schema_copy->refresh_interval = schema->refresh_interval;
+
/* rebuild indexes */
ret = dsdb_setup_sorted_accessors(ldb, schema_copy);
if (ret != LDB_SUCCESS) {
const struct ldb_val *info_val;
struct ldb_val info_val_default;
struct dsdb_schema *schema;
- struct loadparm_context *lp_ctx = NULL;
+ void *lp_opaque = ldb_get_opaque(ldb, "loadparm");
int ret;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
return ldb_operr(ldb);
}
+ if (lp_opaque) {
+ struct loadparm_context *lp_ctx = talloc_get_type_abort(lp_opaque, struct loadparm_context);
+ schema->refresh_interval = lpcfg_parm_int(lp_ctx, NULL, "dsdb", "schema_reload_interval", schema->refresh_interval);
+ lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
+ struct loadparm_context);
+ schema->fsmo.update_allowed = lpcfg_parm_bool(lp_ctx, NULL,
+ "dsdb", "schema update allowed",
+ false);
+ }
+
schema->base_dn = talloc_steal(schema, schema_res->msgs[0]->dn);
prefix_val = ldb_msg_find_ldb_val(schema_res->msgs[0], "prefixMap");
schema->fsmo.we_are_master = false;
}
- lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
- struct loadparm_context);
- if (lp_ctx) {
- bool allowed = lpcfg_parm_bool(lp_ctx, NULL,
- "dsdb", "schema update allowed",
- false);
- schema->fsmo.update_allowed = allowed;
- } else {
- schema->fsmo.update_allowed = false;
- }
-
DEBUG(5, ("schema_fsmo_init: we are master[%s] updates allowed[%s]\n",
(schema->fsmo.we_are_master?"yes":"no"),
(schema->fsmo.update_allowed?"yes":"no")));