From 9d4eeaeb194d071f02b19aaca3ad1b89d81d3637 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 1 Nov 2010 15:23:48 +0100 Subject: s4:objectclass LDB module - the structural objectclass has always to be specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Wed Nov 3 16:20:55 UTC 2010 on sn-devel-104 --- source4/dsdb/samdb/ldb_modules/objectclass.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/dsdb/samdb/ldb_modules/objectclass.c') diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index 474e848c60..9483d3e019 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -518,6 +518,12 @@ static int objectclass_do_add(struct oc_context *ac) talloc_free(mem_ctx); return LDB_ERR_OBJECT_CLASS_VIOLATION; } + if (objectclass_element->num_values == 0) { + ldb_asprintf_errstring(ldb, "objectclass: Cannot add %s, at least one (structural) objectclass has to be specified!", + ldb_dn_get_linearized(msg->dn)); + talloc_free(mem_ctx); + return LDB_ERR_CONSTRAINT_VIOLATION; + } /* Here we do now get the "objectClass" list from the * database. */ -- cgit