From: Pierangelo Masarati Date: Fri, 18 Nov 2005 00:00:39 +0000 (+0000) Subject: better fix to ITS#4183 (the prototype in proto-slap.h was erroneously committed earlier) X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~787 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=55c52c5c72d03a9802f08bdb745621f39c986db9;p=openldap better fix to ITS#4183 (the prototype in proto-slap.h was erroneously committed earlier) --- diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 122784bd16..a1aeb801fc 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -290,7 +290,7 @@ bdb_modify( Operation *op, SlapReply *rs ) ctrls[num_ctrls] = NULL; if ( !SLAP_SHADOW( op->o_bd )) - slap_mods_opattrs( op, op->orm_modlist, 1 ); + slap_mods_opattrs( op, &op->orm_modlist, 1 ); if( 0 ) { retry: /* transaction retry */ diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 1df17bd4f7..246ee28e26 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -242,7 +242,7 @@ ldbm_back_modify( Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0); if ( !SLAP_SHADOW( op->o_bd )) - slap_mods_opattrs( op, op->orm_modlist, 1 ); + slap_mods_opattrs( op, &op->orm_modlist, 1 ); /* grab giant lock for writing */ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock); diff --git a/servers/slapd/back-monitor/modify.c b/servers/slapd/back-monitor/modify.c index 728975360c..04239bbf53 100644 --- a/servers/slapd/back-monitor/modify.c +++ b/servers/slapd/back-monitor/modify.c @@ -70,7 +70,7 @@ monitor_back_modify( Operation *op, SlapReply *rs ) } else { assert( !SLAP_SHADOW( op->o_bd ) ); - slap_mods_opattrs( op, op->orm_modlist, 0 ); + slap_mods_opattrs( op, &op->orm_modlist, 0 ); rc = monitor_entry_modify( op, rs, e ); } diff --git a/servers/slapd/back-sql/modify.c b/servers/slapd/back-sql/modify.c index 2977b3c8d6..2f836d4b4c 100644 --- a/servers/slapd/back-sql/modify.c +++ b/servers/slapd/back-sql/modify.c @@ -122,7 +122,7 @@ backsql_modify( Operation *op, SlapReply *rs ) goto done; } - slap_mods_opattrs( op, op->orm_modlist, 1 ); + slap_mods_opattrs( op, &op->orm_modlist, 1 ); oc = backsql_id2oc( bi, bsi.bsi_base_id.eid_oc_id ); assert( oc != NULL ); diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 1fae806ddf..e97c847ac5 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -169,14 +169,6 @@ do_modify( } *modtail = NULL; - if ( modlist == NULL ) { - Debug( LDAP_DEBUG_ANY, "do_modify: no modifications\n", 0, 0, 0 ); - send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, - "change sequence empty" ); - - goto cleanup; - } - if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 ); @@ -819,7 +811,7 @@ void slap_timestamp( time_t *tm, struct berval *bv ) */ void slap_mods_opattrs( Operation *op, - Modifications *mods, + Modifications **modsp, int manage_ctxcsn ) { struct berval name, timestamp, csn = BER_BVNULL; @@ -861,9 +853,8 @@ void slap_mods_opattrs( nname = op->o_ndn; } - for ( mod = mods; mod->sml_next; mod = mod->sml_next ) + for ( modtail = modsp; *modtail; modtail = &(*modtail)->sml_next ) ; - modtail = &mod->sml_next; mod = (Modifications *) ch_malloc( sizeof( Modifications ) ); mod->sml_op = LDAP_MOD_REPLACE; @@ -881,7 +872,7 @@ void slap_mods_opattrs( modtail = &mod->sml_next; if ( get_manageDIT( op ) ) { - for ( mod = mods; mod != modlast; mod = mod->sml_next ) { + for ( mod = *modsp; mod != modlast; mod = mod->sml_next ) { if ( mod->sml_desc == slap_schema.si_ad_modifiersName ) { break; } @@ -909,7 +900,7 @@ void slap_mods_opattrs( } if ( get_manageDIT( op ) ) { - for ( mod = mods; mod != modlast; mod = mod->sml_next ) { + for ( mod = *modsp; mod != modlast; mod = mod->sml_next ) { if ( mod->sml_desc == slap_schema.si_ad_modifyTimestamp ) { break; }