summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-07-11 23:07:06 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-02 10:40:34 +1000
commit379d073444f7acafb6e5761dd667073ad7371771 (patch)
treebbcfc4403ae2e4e65cb7aef0ec7697445f12cd68 /source4
parent896553a1a85f541f72ab6b45e71d89d00e727791 (diff)
downloadsamba-379d073444f7acafb6e5761dd667073ad7371771.tar.gz
samba-379d073444f7acafb6e5761dd667073ad7371771.tar.bz2
samba-379d073444f7acafb6e5761dd667073ad7371771.zip
s4:dsdb Don't reload the schema against OpenLDAP backend
The schema should be considered read-only when we are using the OL backend, as we can't update the backend schema in real time anyway. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samba_dsdb.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema_load.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
index 82f5ec39d4..cdfc8d7183 100644
--- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
+++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
@@ -260,6 +260,10 @@ static int samba_dsdb_init(struct ldb_module *module)
backend_modules = openldap_backend_modules;
extended_dn_module = extended_dn_module_openldap;
}
+ ret = ldb_set_opaque(ldb, "readOnlySchema", (void*)1);
+ if (ret != LDB_SUCCESS) {
+ ldb_set_errstring(ldb, "Failed to set readOnlySchema opaque");
+ }
}
#define CHECK_MODULE_LIST \
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c
index 15420181ba..28c02099d3 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -225,9 +225,15 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_
}
(*schema)->refresh_in_progress = true;
- (*schema)->refresh_fn = dsdb_schema_refresh;
- (*schema)->loaded_from_module = module;
- (*schema)->loaded_usn = current_usn;
+
+ /* If we have the readOnlySchema opaque, then don't check for
+ * runtime schema updates, as they are not permitted (we would
+ * have to update the backend server schema too */
+ if (!ldb_get_opaque(ldb, "readOnlySchema")) {
+ (*schema)->refresh_fn = dsdb_schema_refresh;
+ (*schema)->loaded_from_module = module;
+ (*schema)->loaded_usn = current_usn;
+ }
/* "dsdb_set_schema()" steals schema into the ldb_context */
ret = dsdb_set_schema(ldb, (*schema));