summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-10-19 06:47:54 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:22 +0100
commit35dc4d9999b6d3284adba96bc408ba55faf3475a (patch)
tree33902d40da93414f2f874cca93f738bab6a4ae29 /source4
parente85370e70355ebaa98a8be60a4d4b2f82fc90415 (diff)
downloadsamba-35dc4d9999b6d3284adba96bc408ba55faf3475a.tar.gz
samba-35dc4d9999b6d3284adba96bc408ba55faf3475a.tar.bz2
samba-35dc4d9999b6d3284adba96bc408ba55faf3475a.zip
r25704: Handle the chicken-and-egg problem of setting up the LDB before we get
a schema. perhaps i need to look into metze's 'load a schema from ldif' code. Andrew Bartlett (This used to be commit f350ef5f19ec755c93c6c09210cdf276d1b66877)
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 97eed3fc5b..93c78fd163 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -217,15 +217,22 @@ static int objectclass_sort(struct ldb_module *module,
* the bottom here */
} while (parent_class);
- if (unsorted) {
- /* This shouldn't happen, and would break MMC, but we can't
- * afford to loose objectClasses. Perhaps there was no 'top',
- * or some other schema error?
- */
- ldb_asprintf_errstring(module->ldb, "objectclass %s is not a valid objectClass in objectClass chain", unsorted->objectclass);
- return LDB_ERR_OBJECT_CLASS_VIOLATION;
+ if (!unsorted) {
+ return LDB_SUCCESS;
}
- return LDB_SUCCESS;
+
+ if (!schema) {
+ /* If we don't have schema yet, then just merge the lists again */
+ DLIST_CONCATENATE(sorted, unsorted, struct class_list *);
+ return LDB_SUCCESS;
+ }
+
+ /* This shouldn't happen, and would break MMC, perhaps there
+ * was no 'top', a conflict in the objectClasses or some other
+ * schema error?
+ */
+ ldb_asprintf_errstring(module->ldb, "objectclass %s is not a valid objectClass in objectClass chain", unsorted->objectclass);
+ return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
static DATA_BLOB *get_sd(struct ldb_module *module, TALLOC_CTX *mem_ctx,