ITS#10398 slapo-memberof/refint: fix clash on subtree renames

memberof must ignore modify ops from refint overlay.
This commit is contained in:
Howard Chu 2025-10-07 19:12:12 +01:00 committed by Quanah Gibson-Mount
parent 81d5126b31
commit 1bc7cd0e2a
2 changed files with 12 additions and 2 deletions

View 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;
}

View 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;