#include <slap.h>
#include <ac/errno.h>
+#include <ac/string.h>
#ifdef DO_KRB5
-#include <ac/string.h>
#include <lber.h>
#include <lber_pvt.h>
#include <lutil.h>
keys[i].bv_val = (char *)buf;
keys[i].bv_len = len;
}
- keys[i].bv_val = NULL;
- keys[i].bv_len = 0;
+ BER_BVZERO( &keys[i] );
_kadm5_free_keys(kadm_context, ent.keys.len, ent.keys.val);
ml->sml_values[0].bv_val = ch_malloc( 64 );
ml->sml_values[0].bv_len = sprintf(ml->sml_values[0].bv_val,
"%d", kvno+1 );
- ml->sml_values[1].bv_val = NULL;
- ml->sml_values[1].bv_len = 0;
+ BER_BVZERO( &ml->sml_values[1] );
ml->sml_nvalues = NULL;
} while(0);
#endif /* DO_KRB5 */
qpw->rs_mods = ml;
keys = ch_malloc( 2 * sizeof(struct berval) );
- keys[1].bv_val = NULL;
- keys[1].bv_len = 0;
+ BER_BVZERO( &keys[1] );
nthash( &pwd, keys );
ml->sml_desc = ad_sambaNTPassword;
qpw->rs_mods = ml;
keys = ch_malloc( 2 * sizeof(struct berval) );
- keys[1].bv_val = NULL;
- keys[1].bv_len = 0;
+ BER_BVZERO( &keys[1] );
lmhash( &pwd, keys );
ml->sml_desc = ad_sambaLMPassword;
qpw->rs_mods = ml;
keys = ch_malloc( 2 * sizeof(struct berval) );
- keys[1].bv_val = NULL;
- keys[1].bv_len = 0;
- keys[0].bv_val = ch_malloc(16);
- keys[0].bv_len = sprintf(keys[0].bv_val, "%ld",
- slap_get_time());
+ keys[0].bv_val = ch_malloc( STRLENOF( "9223372036854775807L" ) + 1 );
+ keys[0].bv_len = snprintf(keys[0].bv_val,
+ STRLENOF( "9223372036854775807L" ) + 1,
+ "%ld", slap_get_time());
+ BER_BVZERO( &keys[1] );
ml->sml_desc = ad_sambaPwdLastSet;
ml->sml_op = LDAP_MOD_REPLACE;