From: Pierangelo Masarati Date: Thu, 18 Aug 2005 08:12:26 +0000 (+0000) Subject: zero out sml_managing any time a Modifications is built (use calloc?) X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~669 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9487629061b6964053e11d1c4f6a2183ff5c740d;p=openldap zero out sml_managing any time a Modifications is built (use calloc?) --- diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index f54f714103..3412b9319b 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -443,6 +443,7 @@ slap_modrdn2mods( } mod_tmp->sml_op = SLAP_MOD_SOFTADD; mod_tmp->sml_flags = SLAP_MOD_INTERNAL; + mod_tmp->sml_managing = 0; mod_tmp->sml_next = mod; mod = mod_tmp; } @@ -498,6 +499,7 @@ slap_modrdn2mods( } mod_tmp->sml_op = LDAP_MOD_DELETE; mod_tmp->sml_flags = SLAP_MOD_INTERNAL; + mod_tmp->sml_managing = 0; mod_tmp->sml_next = mod; mod = mod_tmp; } diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 6d0757c2df..eaa21a7028 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -241,6 +241,7 @@ account_locked( Operation *op, Entry *e, m->sml_flags = 0; m->sml_type = ad_pwdAccountLockedTime->ad_cname; m->sml_desc = ad_pwdAccountLockedTime; + m->sml_managing = 0; m->sml_next = *mod; *mod = m; } @@ -713,6 +714,7 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) m->sml_values = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + m->sml_managing = 0; m->sml_next = mod; mod = m; @@ -759,6 +761,7 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) m->sml_desc = ad_pwdAccountLockedTime; m->sml_values = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + m->sml_managing = 0; m->sml_next = mod; mod = m; } @@ -773,6 +776,7 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) m->sml_flags = 0; m->sml_type = ad_pwdFailureTime->ad_cname; m->sml_desc = ad_pwdFailureTime; + m->sml_managing = 0; m->sml_next = mod; mod = m; } @@ -861,6 +865,7 @@ grace: m->sml_desc = ad_pwdGraceUseTime; m->sml_values = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + m->sml_managing = 0; m->sml_next = mod; mod = m; @@ -1301,6 +1306,7 @@ ppolicy_modify( Operation *op, SlapReply *rs ) ml->sml_values[1].bv_len = 0; ml->sml_values[1].bv_val = NULL; ml->sml_nvalues = NULL; + ml->sml_managing = 0; ml->sml_next = op->orm_modlist; op->orm_modlist = ml; delmod = ml; @@ -1459,6 +1465,7 @@ do_modify: } mods->sml_flags = SLAP_MOD_INTERNAL; mods->sml_nvalues = NULL; + mods->sml_managing = 0; mods->sml_next = NULL; modtail->sml_next = mods; modtail = mods; @@ -1471,6 +1478,7 @@ do_modify: mods->sml_desc = ad_pwdGraceUseTime; mods->sml_values = NULL; mods->sml_nvalues = NULL; + mods->sml_managing = 0; mods->sml_next = NULL; modtail->sml_next = mods; modtail = mods; @@ -1485,6 +1493,7 @@ do_modify: mods->sml_desc = ad_pwdReset; mods->sml_values = NULL; mods->sml_nvalues = NULL; + mods->sml_managing = 0; mods->sml_next = NULL; modtail->sml_next = mods; modtail = mods; @@ -1523,6 +1532,7 @@ do_modify: mods->sml_values[i].bv_len = 0; ber_dupbv( &(mods->sml_values[i]), &p->bv ); } + mods->sml_managing = 0; mods->sml_next = NULL; modtail->sml_next = mods; modtail = mods; @@ -1551,6 +1561,7 @@ do_modify: mods->sml_values[ 1 ].bv_val = NULL; mods->sml_values[ 1 ].bv_len = 0; make_pwd_history_value( timebuf, &mods->sml_values[0], pa ); + mods->sml_managing = 0; mods->sml_next = NULL; modtail->sml_next = mods; modtail = mods; diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index 41e1cbc9cf..d61e105df3 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -294,6 +294,7 @@ refint_delete_cb( mp->sml_flags = 0; ber_dupbv(&mp->sml_values[0], &dd->nothing); ber_dupbv(&mp->sml_nvalues[0], &dd->nnothing); + mp->sml_managing = 0; mp->sml_next = ma; ma = mp; } @@ -309,6 +310,7 @@ refint_delete_cb( mp->sml_flags = 0; ber_dupbv(&mp->sml_values[0], &dd->dn); ber_dupbv(&mp->sml_nvalues[0], &mp->sml_values[0]); + mp->sml_managing = 0; mp->sml_next = ma; ma = mp; Debug(LDAP_DEBUG_TRACE, "refint_delete_cb: %s: %s\n", @@ -400,6 +402,7 @@ refint_modrdn_cb( ber_dupbv(&mp->sml_nvalues[0], &dd->nnewdn); mp->sml_values[1].bv_len = mp->sml_nvalues[1].bv_len = 0; mp->sml_values[1].bv_val = mp->sml_nvalues[1].bv_val = NULL; + mp->sml_managing = 0; mp->sml_next = ip->mm; ip->mm = mp; mp = ch_malloc(sizeof(Modifications)); @@ -413,6 +416,7 @@ refint_modrdn_cb( ber_dupbv(&mp->sml_nvalues[0], &dd->dn); mp->sml_values[1].bv_len = mp->sml_nvalues[1].bv_len = 0; mp->sml_values[1].bv_val = mp->sml_nvalues[1].bv_val = NULL; + mp->sml_managing = 0; mp->sml_next = ip->mm; ip->mm = mp; Debug(LDAP_DEBUG_TRACE, "refint_modrdn_cb: %s: %s\n", diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 3d63e447fe..8a187bca92 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -226,6 +226,7 @@ int passwd_extop( ml->sml_desc = slap_schema.si_ad_userPassword; ml->sml_op = LDAP_MOD_REPLACE; ml->sml_flags = 0; + ml->sml_managing = 0; ml->sml_next = qpw->rs_mods; qpw->rs_mods = ml; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 66c591a956..645889ef85 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -460,6 +460,7 @@ slap_auxprop_store( BER_BVZERO( &mod->sml_values[j] ); mod->sml_nvalues = NULL; mod->sml_desc = NULL; + mod->sml_managing = 0; *modtail = mod; modtail = &mod->sml_next; } diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 4ca77f8463..a2c707a4ed 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1102,6 +1102,7 @@ syncrepl_message_to_entry( mod->sml_type = tmp.sml_type; mod->sml_values = tmp.sml_values; mod->sml_nvalues = NULL; + mod->sml_managing = 0; *modtail = mod; modtail = &mod->sml_next; @@ -1478,6 +1479,7 @@ retry_add:; mod->sml_type = mod->sml_desc->ad_cname; mod->sml_values = NULL; mod->sml_nvalues = NULL; + mod->sml_managing = 0; if ( !modhead ) modhead = mod; if ( modtail ) { modtail->sml_next = mod; @@ -1507,6 +1509,7 @@ retry_add:; ber_bvarray_add( &mod->sml_values, &uuid_bv ); ber_dupbv( &uuid_bv, syncUUID ); ber_bvarray_add( &mod->sml_nvalues, &uuid_bv ); + mod->sml_managing = 0; modtail->sml_next = mod; op->o_tag = LDAP_REQ_MODIFY;