]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10398 slapo-memberof/refint: fix clash on subtree renames
authorHoward Chu <hyc@openldap.org>
Tue, 7 Oct 2025 18:12:12 +0000 (19:12 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 18 Nov 2025 16:35:59 +0000 (16:35 +0000)
memberof must ignore modify ops from refint overlay.

servers/slapd/overlays/memberof.c
servers/slapd/overlays/refint.c

index 46232e45c8b617b15f9a1cb5b963ead11bb9d43f..ac73c84b4b319d3a714b83b321fd742b21df4316 100644 (file)
@@ -136,6 +136,7 @@ static AttributeDescription *ad_memberOf;
 static ObjectClass                     *oc_group;
 
 static slap_overinst           memberof;
+static slap_overinst           *oi_refint;
 
 typedef struct memberof_t {
        struct berval           mo_dn;
@@ -906,6 +907,8 @@ memberof_op_modify( Operation *op, SlapReply *rs )
        LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
                if ( oex->oe_key == (void *)&memberof )
                        return SLAP_CB_CONTINUE;
+               if ( oi_refint && oex->oe_key == oi_refint )
+                       return SLAP_CB_CONTINUE;
        }
 
        if ( MEMBEROF_REVERSE( mo ) ) {
@@ -2154,8 +2157,7 @@ mo_cf_gen( ConfigArgs *c )
                                if ( SLAP_ISGLOBALOVERLAY( c->be ) ) {
                                        snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                                "addcheck functionality not supported "
-                                               "when memberof is a global overlay",
-                                               c->argv[ 1 ] );
+                                               "when memberof is a global overlay" );
                                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                                c->log, c->cr_msg );
                                        return 1;
@@ -2211,6 +2213,8 @@ memberof_db_open(
                memberof_make_member_filter( mo );
        }
 
+       oi_refint = overlay_find( "refint" );
+
        return 0;
 }
 
index 1bcaf0ee9db5034eafe21ae4d184c9b5f4b5ddb0..ddea9d6b380422b80fb9eddde7550ae6bf7784ce 100644 (file)
@@ -596,6 +596,7 @@ refint_repair(
        unsigned long   opid;
        int             rc;
        int     cache;
+       OpExtra oex;
 
        op->o_callback->sc_response = refint_search_cb;
        op->o_req_dn = op->o_bd->be_suffix[ 0 ];
@@ -638,6 +639,11 @@ refint_repair(
 
        opid = op->o_opid;
        op2 = *op;
+
+       /* mark this mod as one of ours */
+       oex.oe_key = (void *)&refint;
+       LDAP_SLIST_INSERT_HEAD( &op2.o_extra, &oex, oe_next );
+
        for ( dp = rq->attrs; dp; dp = dp->next ) {
                SlapReply       rs2 = {REP_RESULT};
                refint_attrs    *ra;