summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-07 05:58:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:32 -0500
commitae7819d715e80cfbd17c4bec1c93685198febe6a (patch)
treef3ef439b96f98500d110bcc26aad074b8a8a2cb7 /source4/dsdb/samdb/ldb_modules
parent49c42e2550fe7340b88e910f621fef1678b571e3 (diff)
downloadsamba-ae7819d715e80cfbd17c4bec1c93685198febe6a.tar.gz
samba-ae7819d715e80cfbd17c4bec1c93685198febe6a.tar.bz2
samba-ae7819d715e80cfbd17c4bec1c93685198febe6a.zip
r24262: Set the objectCategory by default in the objectclass module, rather than using templates.
Modify the samba3sam test to be less fussy, and not use the objectclass module (which requires proper schema stuff now). Andrew Bartlett (This used to be commit 53c248c2645e86fbc8720860aed92a479483b528)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index ad11442035..259b963ce0 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -161,7 +161,7 @@ static int objectclass_sort(struct ldb_module *module,
/* Save the next pointer, as the DLIST_ macros will change poss_subclass->next */
next = poss_subclass->next;
- if (ldb_attr_cmp(class->subClassOf, current->objectclass) == 0) {
+ if (class && ldb_attr_cmp(class->subClassOf, current->objectclass) == 0) {
DLIST_REMOVE(unsorted, poss_subclass);
DLIST_ADD(subclass, poss_subclass);
@@ -199,6 +199,7 @@ static int objectclass_sort(struct ldb_module *module,
static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
{
struct ldb_message_element *objectclass_element;
+ const struct dsdb_schema *schema = dsdb_get_schema(module->ldb);
struct class_list *sorted, *current;
struct ldb_request *down_req;
struct ldb_message *msg;
@@ -265,6 +266,14 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
talloc_free(mem_ctx);
return ret;
}
+ /* Last one */
+ if (schema && !current->next && !ldb_msg_find_element(msg, "objectCategory")) {
+ const struct dsdb_class *objectclass
+ = dsdb_class_by_lDAPDisplayName(schema, current->objectclass);
+ if (objectclass) {
+ ldb_msg_add_string(msg, "objectCategory", objectclass->defaultObjectCategory);
+ }
+ }
}
talloc_free(mem_ctx);