int ret;
schema = dsdb_get_schema(ldb, NULL);
- DBG_DEBUG("PID[%d] ac[%p] modify_schema[%p]\n",
+ DBG_ERR("PID[%d] ac[%p] modify_schema[%p]\n",
getpid(), ac, schema);
ret = dsdb_set_global_schema(ldb);
if (ret != LDB_SUCCESS) {
ldb_debug_set(ldb, LDB_DEBUG_FATAL,
"dsdb_set_global_schema() failed: %d:%s: %s",
ret, ldb_strerror(ret), ldb_errstring(ldb));
- return ret;
+ return ldb_module_done(ac->req, NULL, NULL, ret);
}
ac->modified_schema = false;
schema = dsdb_get_schema(ldb, NULL);
- DBG_DEBUG("PID[%d] ac[%p] schema[%p|%llu]\n",
+ DBG_ERR("PID[%d] ac[%p] schema[%p|%llu]\n",
getpid(), ac, schema, (unsigned long long)schema->metadata_usn);
}
active_schema = schema;
if (modify_schema != NULL) {
- DBG_DEBUG("PID[%d] ac[%p] schema[%p|%llu] modify_schema[%p]\n%s\n",
+ DBG_ERR("PID[%d] ac[%p] schema[%p|%llu] modify_schema[%p]\n%s\n",
getpid(), ac, schema, (unsigned long long)schema->metadata_usn, modify_schema,
ldb_dn_get_linearized(msg->dn));
ret = dsdb_set_schema(ldb, modify_schema, SCHEMA_MEMORY_ONLY);
ac->modified_schema = true;
}
+ if (!talloc_reference(msg, active_schema)) {
+ return ldb_oom(ldb);
+ }
+
ret = resolve_oids_message_replace(ldb, active_schema, msg);
if (ret != LDB_SUCCESS) {
return ret;