s4:schema Expand the schema structure
authorAndrew Bartlett <abartlet@samba.org>
Mon, 22 Mar 2010 04:41:51 +0000 (15:41 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Mar 2010 09:24:41 +0000 (20:24 +1100)
We now store the location of the schema in the schema, and provide
hooks for a future schema reloading mechanism.

Andrew Bartlett

source4/dsdb/schema/schema.h
source4/dsdb/schema/schema_init.c

index fb1bd3cf91287f931e45923f7e85b881300a534f..b5334c731352da441c7c3a5b328acc798642858c 100644 (file)
@@ -167,6 +167,7 @@ struct dsdb_class {
 
 
 struct dsdb_schema {
+       struct ldb_dn *base_dn;
 
        struct dsdb_schema_prefixmap *prefixmap;
 
@@ -180,6 +181,9 @@ struct dsdb_schema {
         */
        const char *schema_info;
 
+       /* We can also tell the schema version from the USN on the partition */
+       uint64_t loaded_usn;
+
        struct dsdb_attribute *attributes;
        struct dsdb_class *classes;
 
@@ -204,6 +208,11 @@ struct dsdb_schema {
        } fsmo;
 
        struct smb_iconv_convenience *iconv_convenience;
+
+       /* Was this schema loaded from ldb (if so, then we will reload it when we detect a change in ldb) */
+       struct ldb_module *loaded_from_module;
+       struct dsdb_schema *(*refresh_fn)(struct ldb_module *module, struct dsdb_schema *schema, bool is_global_schema);
+       bool refresh_in_progress;
 };
 
 enum dsdb_attr_list_query {
index 949c1ea06930ee8761b4be2e252819fe4b8bcadb..c7fcdaecdcd75207a500a72409573c94cc767f12 100644 (file)
@@ -725,6 +725,8 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
+       schema->base_dn = talloc_steal(schema, schema_res->msgs[0]->dn);
+
        prefix_val = ldb_msg_find_ldb_val(schema_res->msgs[0], "prefixMap");
        if (!prefix_val) {
                *error_string = talloc_asprintf(mem_ctx,