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

abartlet at samba.org abartlet at samba.org
Fri Oct 19 05:40:01 GMT 2007


Author: abartlet
Date: 2007-10-19 05:40:00 +0000 (Fri, 19 Oct 2007)
New Revision: 25702

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

Log:
Clarify comments and make this module more strict on objectclasses.
This is becoming the schema module...

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:39:08 UTC (rev 25701)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c	2007-10-19 05:40:00 UTC (rev 25702)
@@ -217,16 +217,14 @@
 		 * the bottom here */
 	} while (parent_class);
 
-	/* 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? 
-	 *
-	 * Detecting schema errors is the job of the schema module, so
-	 * at this layer we just try not to loose data
- 	 */
-	DLIST_CONCATENATE(sorted, unsorted, struct class_list *);
-
-	*sorted_out = sorted;
+	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;
+	}
 	return LDB_SUCCESS;
 }
 
@@ -397,6 +395,7 @@
 	case LDB_FLAG_MOD_DELETE:
 		/* Delete everything?  Probably totally illigal, but hey! */
 		if (objectclass_element->num_values == 0) {
+			
 			return ldb_next_request(module, req);
 		}
 		break;
@@ -474,6 +473,10 @@
 	}
 	}
 
+	/* This isn't the default branch of the switch, but a 'in any
+	 * other case'.  When a delete isn't for all objectClasses for
+	 * example
+	 */
 	{
 		struct ldb_handle *h;
 		struct oc_context *ac;



More information about the samba-cvs mailing list