From 5585591b2e6959bebb005966ad72eb7af4bf1760 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 12 Nov 2010 18:57:57 +0100 Subject: s4:samldb/objectclass_attrs LDB modules - move "description" logic from "objectclass_attrs" into "samldb" This according to an answer from dochelp is SAM specific behaviour. --- source4/dsdb/samdb/ldb_modules/objectclass_attrs.c | 43 ---------------------- 1 file changed, 43 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/objectclass_attrs.c') diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c index 26eaaeaae5..67d11b302d 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c @@ -158,49 +158,6 @@ static int attr_handler(struct oc_context *ac) } } - /* "description" on AD is very special: it's nearly single- - * valued (only on add operations it isn't). */ - if ((ac->req->operation == LDB_MODIFY) && - (ldb_attr_cmp(attr->lDAPDisplayName, "description") == 0)) { - /* Multi-valued add or replace operations are always - * denied */ - if ((LDB_FLAG_MOD_TYPE(msg->elements[i].flags) - != LDB_FLAG_MOD_DELETE) && - (msg->elements[i].num_values > 1)) { - ldb_asprintf_errstring(ldb, - "objectclass_attrs: attribute '%s' on entry '%s' is changed using a multi-valued add or replace operation!", - msg->elements[i].name, - ldb_dn_get_linearized(msg->dn)); - return LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS; - } - - /* Add operations are only allowed if no value exists */ - if (LDB_FLAG_MOD_TYPE(msg->elements[i].flags) - == LDB_FLAG_MOD_ADD) { - const char *attrs[] = { attr->lDAPDisplayName, - NULL }; - struct ldb_result *res; - struct ldb_message_element *el; - - ret = ldb_search(ldb, ac, &res, msg->dn, - LDB_SCOPE_BASE, attrs, NULL); - if (ret != LDB_SUCCESS) { - return ret; - } - - el = ldb_msg_find_element(res->msgs[0], - attr->lDAPDisplayName); - if (el != NULL) { - ldb_asprintf_errstring(ldb, - "objectclass_attrs: attribute '%s' on entry '%s' is changed using an add operation, but there a value already exists!", - msg->elements[i].name, - ldb_dn_get_linearized(msg->dn)); - return LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS; - } - talloc_free(res); - } - } - /* "dSHeuristics" syntax check */ if (ldb_attr_cmp(attr->lDAPDisplayName, "dSHeuristics") == 0) { ret = oc_validate_dsheuristics(&(msg->elements[i])); -- cgit