From c2b660f3d723c04f6452d54bb8724f0e0e163f64 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 19 Jan 2006 22:16:23 +0000 Subject: [PATCH] ITS#4355 timestamps must be normalized --- servers/slapd/overlays/ppolicy.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 3403e80847..bed5b4b366 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -731,8 +731,10 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) m->sml_type = ad_pwdFailureTime->ad_cname; m->sml_desc = ad_pwdFailureTime; m->sml_values = ch_calloc( sizeof(struct berval), 2 ); + m->sml_nvalues = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + ber_dupbv( &m->sml_nvalues[0], ×tamp ); m->sml_next = mod; mod = m; @@ -778,7 +780,9 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) m->sml_type = ad_pwdAccountLockedTime->ad_cname; m->sml_desc = ad_pwdAccountLockedTime; m->sml_values = ch_calloc( sizeof(struct berval), 2 ); + m->sml_nvalues = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + ber_dupbv( &m->sml_nvalues[0], ×tamp ); m->sml_next = mod; mod = m; } @@ -880,7 +884,9 @@ grace: m->sml_type = ad_pwdGraceUseTime->ad_cname; m->sml_desc = ad_pwdGraceUseTime; m->sml_values = ch_calloc( sizeof(struct berval), 2 ); + m->sml_nvalues = ch_calloc( sizeof(struct berval), 2 ); ber_dupbv( &m->sml_values[0], ×tamp ); + ber_dupbv( &m->sml_nvalues[0], ×tamp ); m->sml_next = mod; mod = m; @@ -1155,7 +1161,7 @@ ppolicy_add( timestamp.bv_len = sizeof(timebuf); slap_timestamp( &now, ×tamp ); - attr_merge_one( op->ora_e, ad_pwdChangedTime, ×tamp, NULL ); + attr_merge_one( op->ora_e, ad_pwdChangedTime, ×tamp, ×tamp ); } } return SLAP_CB_CONTINUE; @@ -1568,7 +1574,9 @@ do_modify: if (pwmop != LDAP_MOD_DELETE) { mods->sml_op = LDAP_MOD_REPLACE; mods->sml_values = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); + mods->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mods->sml_values[0], ×tamp ); + ber_dupbv( &mods->sml_nvalues[0], ×tamp ); mods->sml_values[1].bv_len = 0; mods->sml_values[1].bv_val = NULL; assert( mods->sml_values[0].bv_val != NULL ); -- 2.39.5