]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8775 for passwordMod, pass real DN thru
authorHoward Chu <hyc@openldap.org>
Tue, 20 Jul 2021 18:27:45 +0000 (19:27 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 20 Jul 2021 18:27:45 +0000 (19:27 +0100)
Since conn->c_dn is the real DN, need to see real DN for <self>
ACLs to work.

servers/slapd/overlays/rwm.c

index 7b0768d539c8b3c9cdbf64f875700114694d5ac8..7ba80103b9fb65a2cb8a1e9704b25b46cc0f61b7 100644 (file)
@@ -867,6 +867,8 @@ rwm_entry_release_rw( Operation *op, Entry *e, int rw )
        return SLAP_CB_CONTINUE;
 }
 
+static struct berval *passwd_oid;
+
 static int
 rwm_entry_get_rw( Operation *op, struct berval *ndn,
        ObjectClass *oc, AttributeDescription *at, int rw, Entry **ep )
@@ -884,6 +886,11 @@ rwm_entry_get_rw( Operation *op, struct berval *ndn,
                return SLAP_CB_CONTINUE;
        }
 
+       /* If we're fetching the target of a password mod, must let real DNs thru */
+       if ( op->o_tag == LDAP_REQ_EXTENDED && bvmatch( passwd_oid, &op->oq_extended.rs_reqoid ) ) {
+               return SLAP_CB_CONTINUE;
+       }
+
        /* massage DN */
        op2.o_tag = LDAP_REQ_SEARCH;
        op2 = *op;
@@ -1116,6 +1123,8 @@ static struct exop {
        { BER_BVNULL, NULL }
 };
 
+static struct berval *passwd_oid = &exop_table[0].oid;
+
 static int
 rwm_extended( Operation *op, SlapReply *rs )
 {