s4:objectclass LDB module - if we cannot find DN's parent then the DN itself is invalid
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 2 Mar 2011 17:50:11 +0000 (18:50 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 4 Mar 2011 07:51:29 +0000 (08:51 +0100)
ERR_INVALID_DN_SYNTAX fits better than ERR_OPERATION_ERROR in this case. This
one gets triggered if we perform "add" requests without the LDAP server.

Reviewed by: Tridge

source4/dsdb/samdb/ldb_modules/objectclass.c

index f48917c5fd7e51bc4233712f2a556e6b96912cda..817f50a96442514f60e902bfc8e3ab15fe7954ae 100644 (file)
@@ -421,7 +421,9 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
        /* get copy of parent DN */
        parent_dn = ldb_dn_get_parent(ac, ac->req->op.add.message->dn);
        if (parent_dn == NULL) {
-               return ldb_operr(ldb);
+               /* the DN itself might be wrong - therefore
+                * "ERR_INVALID_DN_SYNTAX" fits better here. */
+               return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
        ret = ldb_build_search_req(&search_req, ldb,