From cf37c29cd009f9378ffa4d3ee54b38aef9fa066b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Nov 2010 20:02:16 +1100 Subject: Move the checking of single valued attributes back into the tdb backend. The backend is the only place that can do this properly. It makes no sense to do it anywhere else. As a result of it moving out of the backend we ended up with some bugs causing multiple values in single valued attributes (eg. isDeleted), which can really damage the inregrity of the database. For the override of single valued values needed for deleted linked attributes we should use attribute flags. This reverts commit 1949864417f3d10fb8996df7db259649eb777271. --- source4/dsdb/samdb/ldb_modules/objectclass_attrs.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c index 62bc9ae8b2..ed193491d1 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c @@ -296,18 +296,6 @@ static int attr_handler2(struct oc_context *ac) return ldb_operr(ldb); } - /* Check if they're single-valued if this is requested */ - if ((msg->elements[i].num_values > 1) && (attr->isSingleValued)) { - ldb_asprintf_errstring(ldb, "objectclass_attrs: attribute '%s' on entry '%s' is single-valued!", - msg->elements[i].name, - ldb_dn_get_linearized(msg->dn)); - if (ac->req->operation == LDB_ADD) { - return LDB_ERR_CONSTRAINT_VIOLATION; - } else { - return LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS; - } - } - /* We can use "str_list_check" with "strcmp" here since the * attribute informations from the schema are always equal * up-down-cased. */ -- cgit