dsdb:extended_dn_store: ignore DRSUAPI_ATTID_distinguishedName attributes
authorStefan Metzmacher <metze@samba.org>
Wed, 28 Feb 2018 07:04:58 +0000 (08:04 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 19 Mar 2018 19:30:49 +0000 (20:30 +0100)
We have several tests which already test that, we can avoid doing
searches at all in that case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13307

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/dsdb/samdb/ldb_modules/extended_dn_store.c

index a32ab8d6f935d89870787170c4b772d855e62731..8829de03a051822ea5660cd5b9ef9dcb70c50752 100644 (file)
@@ -331,6 +331,11 @@ static int extended_dn_add(struct ldb_module *module, struct ldb_request *req)
                        continue;
                }
 
+               if (schema_attr->attributeID_id == DRSUAPI_ATTID_distinguishedName) {
+                       /* distinguishedName values are ignored */
+                       continue;
+               }
+
                /* Before we setup a procedure to modify the incoming message, we must copy it */
                if (!ac->new_req) {
                        struct ldb_message *msg = ldb_msg_copy(ac, req->op.add.message);
@@ -413,6 +418,11 @@ static int extended_dn_modify(struct ldb_module *module, struct ldb_request *req
                        continue;
                }
 
+               if (schema_attr->attributeID_id == DRSUAPI_ATTID_distinguishedName) {
+                       /* distinguishedName values are ignored */
+                       continue;
+               }
+
                /* Before we setup a procedure to modify the incoming message, we must copy it */
                if (!ac->new_req) {
                        struct ldb_message *msg = ldb_msg_copy(ac, req->op.mod.message);