dsdb: Remove readOnlySchema concept from Samba
authorAndrew Bartlett <abartlet@samba.org>
Sun, 16 Dec 2018 21:17:08 +0000 (10:17 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 17 Dec 2018 00:24:14 +0000 (01:24 +0100)
This is a hold-over from the LDAP backend project, which has not yet been revived.

There will be bigger issues than what to do if the schema changes if this ever comes back
and our schema code is way to complex at the moment.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/samba_dsdb.c
source4/dsdb/samdb/ldb_modules/schema_load.c

index fa58f19db29a44447298ffae3479a7567550d58a..3356999f342bae79b789eef3bb61ff29e1e5ed3a 100644 (file)
@@ -541,11 +541,6 @@ static int samba_dsdb_init(struct ldb_module *module)
                } else {
                        return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, "invalid backend type");
                }
-               ret = ldb_set_opaque(ldb, "readOnlySchema", (void*)1);
-               if (ret != LDB_SUCCESS) {
-                       ldb_set_errstring(ldb, "Failed to set readOnlySchema opaque");
-               }
-
                cred = ldb_get_opaque(ldb, "credentials");
                if (!cred || !cli_credentials_authentication_requested(cred)) {
                        ret = set_ldap_credentials(ldb, use_sasl_external);
index 6a3001d05e4adc9d33bd963605452c1d306bba6a..d9396c9c933e23c307815228c6ffcccecb1f4467 100644 (file)
@@ -386,7 +386,6 @@ static int schema_load(struct ldb_context *ldb,
                       bool *need_write)
 {
        struct dsdb_schema *schema;
-       void *readOnlySchema;
        int ret, metadata_ret;
        TALLOC_CTX *frame = talloc_stackframe();
        
@@ -413,33 +412,7 @@ static int schema_load(struct ldb_context *ldb,
                return LDB_SUCCESS;
        }
 
-       readOnlySchema = ldb_get_opaque(ldb, "readOnlySchema");
-
-       /* 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 (readOnlySchema != NULL) {
-               struct dsdb_schema *new_schema;
-               ret = dsdb_schema_from_db(module, frame, 0, &new_schema);
-               if (ret != LDB_SUCCESS) {
-                       ldb_debug_set(ldb, LDB_DEBUG_FATAL,
-                                     "schema_load_init: dsdb_schema_from_db() failed: %d:%s: %s",
-                                     ret, ldb_strerror(ret), ldb_errstring(ldb));
-                       TALLOC_FREE(frame);
-                       return ret;
-               }
-
-               /* "dsdb_set_schema()" steals schema into the ldb_context */
-               ret = dsdb_set_schema(ldb, new_schema, SCHEMA_MEMORY_ONLY);
-               if (ret != LDB_SUCCESS) {
-                       ldb_debug_set(ldb, LDB_DEBUG_FATAL,
-                                     "schema_load_init: dsdb_set_schema() failed: %d:%s: %s",
-                                     ret, ldb_strerror(ret), ldb_errstring(ldb));
-                       TALLOC_FREE(frame);
-                       return ret;
-               }
-
-       } else if (metadata_ret == LDB_SUCCESS) {
+       if (metadata_ret == LDB_SUCCESS) {
                ret = dsdb_set_schema_refresh_function(ldb, dsdb_schema_refresh, module);
 
                if (ret != LDB_SUCCESS) {