summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-10-19 05:40:00 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:21 +0100
commitc4ebf9587f66ce171f0c4778921c358eb5b94da3 (patch)
tree05705efd337b7c00d1c9b3184dea09b3eb6d16d3 /source4/dsdb/samdb
parent761997855344befecaf0c1c18809387f0e8c9e3a (diff)
downloadsamba-c4ebf9587f66ce171f0c4778921c358eb5b94da3.tar.gz
samba-c4ebf9587f66ce171f0c4778921c358eb5b94da3.tar.bz2
samba-c4ebf9587f66ce171f0c4778921c358eb5b94da3.zip
r25702: Clarify comments and make this module more strict on objectclasses.
This is becoming the schema module... Andrew Bartlett (This used to be commit ecea817a3e793f8ac0187dd83a29e62a7d645868)
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index f2ca92638d..97eed3fc5b 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -217,16 +217,14 @@ static int objectclass_sort(struct ldb_module *module,
* 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 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
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 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
}
}
+ /* 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;