diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-05-03 22:53:14 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-05-23 01:13:25 +0200 |
commit | 5f0e53f1b90369c649688122c0a8742352f13877 (patch) | |
tree | 6b62d5b1fc8e118bd60366ddc891c0dd78b19c98 /source4/dsdb/schema/schema_set.c | |
parent | b8ba0103bf45670c31384c56d6cd63bbef760a0c (diff) | |
download | samba-5f0e53f1b90369c649688122c0a8742352f13877.tar.gz |
dsdb: Do not write the @INDEXLIST or @ATTRIBUTES records during schema refresh
Instead, write it once in the module init, if required, and after a
modify to the schema partition is detected
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb/schema/schema_set.c')
-rw-r--r-- | source4/dsdb/schema/schema_set.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 2e688d07546..d3e3cc8f55b 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -56,7 +56,9 @@ const struct ldb_schema_attribute *dsdb_attribute_handler_override(struct ldb_co * are required so we can operate on a schema-less database (say the * backend during emergency fixes) and during the schema load. */ -static int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb, struct dsdb_schema *schema, bool write_indices_and_attributes) +int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb, + struct dsdb_schema *schema, + bool write_indices_and_attributes) { int ret = LDB_SUCCESS; struct ldb_result *res; @@ -468,7 +470,9 @@ int dsdb_set_schema_refresh_function(struct ldb_context *ldb, * Attach the schema to an opaque pointer on the ldb, * so ldb modules can find it */ -int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema) +int dsdb_set_schema(struct ldb_context *ldb, + struct dsdb_schema *schema, + bool write_indices_and_attributes) { struct dsdb_schema *old_schema; int ret; @@ -493,7 +497,8 @@ int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema) talloc_steal(ldb, schema); /* Set the new attributes based on the new schema */ - ret = dsdb_schema_set_indices_and_attributes(ldb, schema, true); + ret = dsdb_schema_set_indices_and_attributes(ldb, schema, + write_indices_and_attributes); if (ret != LDB_SUCCESS) { return ret; } @@ -884,7 +889,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, } } - ret = dsdb_set_schema(ldb, schema); + ret = dsdb_set_schema(ldb, schema, true); if (ret != LDB_SUCCESS) { status = WERR_FOOBAR; goto failed; |