s4:objectclass LDB module - add an error message when someone tries to add entries...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 17 Jun 2010 13:32:48 +0000 (15:32 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 19 Jun 2010 15:53:15 +0000 (17:53 +0200)
source4/dsdb/samdb/ldb_modules/objectclass.c

index 4cbb1897fe8a298ab58704f07ebcd4d78ced0476..0c0590251ceaca868014c1c258e3ec76d554754f 100644 (file)
@@ -398,9 +398,10 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
                }
        }
 
-       /* the objectClass must be specified on add */
-       if (ldb_msg_find_element(req->op.add.message, 
-                                "objectClass") == NULL) {
+       /* the various objectclasses must be specified on add operations */
+       if (ldb_msg_find_element(req->op.add.message, "objectClass") == NULL) {
+               ldb_asprintf_errstring(ldb, "objectclass: Cannot add %s, no objectclass specified!",
+                                      ldb_dn_get_linearized(req->op.add.message->dn));
                return LDB_ERR_OBJECT_CLASS_VIOLATION;
        }