svn commit: samba r25704 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

abartlet at samba.org abartlet at samba.org
Fri Oct 19 06:47:55 GMT 2007


Author: abartlet
Date: 2007-10-19 06:47:54 +0000 (Fri, 19 Oct 2007)
New Revision: 25704

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25704

Log:
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

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c	2007-10-19 05:41:32 UTC (rev 25703)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c	2007-10-19 06:47:54 UTC (rev 25704)
@@ -217,15 +217,22 @@
 		 * 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, 



More information about the samba-cvs mailing list