diff options
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 8385ac2def..752d4f57dd 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -39,6 +39,7 @@ struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx) if (!schema) { return NULL; } + schema->refresh_interval = 120; return schema; } @@ -93,6 +94,8 @@ struct dsdb_schema *dsdb_schema_copy_shallow(TALLOC_CTX *mem_ctx, } 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) { @@ -840,7 +843,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, 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); @@ -856,6 +859,16 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, 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"); @@ -903,17 +916,6 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, 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"))); |