Commits (2)
......@@ -2,6 +2,7 @@ OpenLDAP 2.5 Change Log
OpenLDAP 2.5.10 Engineering
Fixed libldap to init client socket port (ITS#9743)
Fixed slapd-mdb to update indices correctly on replace ops (ITS#9753)
Fixed slapo-dynlist compare operation for static groups (ITS#9747)
Fixed slapo-accesslog to fix inconsistently normalized minCSN (ITS#9752)
Documentation
......
......@@ -27,11 +27,14 @@ static struct berval scbva[] = {
BER_BVNULL
};
#define CHECK_ADD 1
#define CHECK_DEL 2
static void
mdb_modify_idxflags(
Operation *op,
AttributeDescription *desc,
int got_delete,
int ixcheck,
Attribute *newattrs,
Attribute *oldattrs )
{
......@@ -42,7 +45,7 @@ mdb_modify_idxflags(
* but not in case of NOOP... */
ai = mdb_index_mask( op->o_bd, desc, &ix_at );
if ( ai ) {
if ( got_delete ) {
if ( ixcheck & CHECK_DEL ) {
Attribute *ap;
struct berval ix2;
......@@ -65,7 +68,8 @@ mdb_modify_idxflags(
}
}
} else {
}
if ( ixcheck & CHECK_ADD ) {
Attribute *ap;
ap = attr_find( newattrs, desc );
......@@ -91,7 +95,7 @@ int mdb_modify_internal(
Attribute *ap, *aold, *anew;
int glue_attr_delete = 0;
int softop, chkpresent;
int got_delete;
int ixcheck;
int a_flags;
MDB_cursor *mvc = NULL;
......@@ -140,7 +144,7 @@ int mdb_modify_internal(
for ( ml = modlist; ml != NULL; ml = ml->sml_next ) {
mod = &ml->sml_mod;
got_delete = 0;
ixcheck = 0;
aold = attr_find( e->e_attrs, mod->sm_desc );
if (aold)
......@@ -207,6 +211,7 @@ mval_fail: strncpy( textbuf, mdb_strerror( err ), textlen );
if ( err )
goto mval_fail;
}
ixcheck |= CHECK_ADD;
}
break;
......@@ -237,7 +242,7 @@ do_del:
err, *text );
} else {
if (softop != 2)
got_delete = 1;
ixcheck |= CHECK_DEL;
/* check for big multivalued attrs */
if (a_flags & SLAP_ATTR_BIG_MULTI) {
Attribute a_dummy;
......@@ -285,7 +290,9 @@ do_del:
err, *text );
} else {
unsigned hi;
got_delete = 1;
ixcheck = CHECK_DEL;
if ( mod->sm_numvals )
ixcheck |= CHECK_ADD;
if (a_flags & SLAP_ATTR_BIG_MULTI) {
Attribute a_dummy;
if (!mvc) {
......@@ -331,7 +338,7 @@ do_del:
"mdb_modify_internal: %d %s\n",
err, *text );
} else {
got_delete = 1;
ixcheck = CHECK_ADD|CHECK_DEL;
}
break;
......@@ -403,7 +410,7 @@ do_del:
/* check if modified attribute was indexed
* but not in case of NOOP... */
if ( !op->o_noop ) {
mdb_modify_idxflags( op, mod->sm_desc, got_delete, e->e_attrs, save_attrs );
mdb_modify_idxflags( op, mod->sm_desc, ixcheck, e->e_attrs, save_attrs );
}
}
......@@ -434,7 +441,7 @@ do_del:
assert( ap->a_desc == slap_schema.si_ad_structuralObjectClass );
if ( !op->o_noop ) {
mdb_modify_idxflags( op, slap_schema.si_ad_structuralObjectClass,
1, e->e_attrs, save_attrs );
CHECK_ADD|CHECK_DEL, e->e_attrs, save_attrs );
}
}
......