}
ml->sml_values = ch_malloc( (nhash+1)*sizeof(struct berval) );
for ( i=0; hashes[i]; i++ ) {
- slap_passwd_hash( hashes[i], &qpw->rs_new, &hash, &rs->sr_text );
+ slap_passwd_hash_type( &qpw->rs_new, &hash, hashes[i], &rs->sr_text );
if ( hash.bv_len == 0 ) {
if ( !rs->sr_text ) {
rs->sr_text = "password hash failed";
ml->sml_op = LDAP_MOD_REPLACE;
ml->sml_next = qpw->rs_mods;
qpw->rs_mods = ml;
- if ( rsp ) {
- free( qpw->rs_new.bv_val );
- }
+
if ( hashes[i] ) {
rs->sr_err = LDAP_OTHER;
} else {
op2.o_tag = LDAP_REQ_MODIFY;
op2.o_callback = &cb2;
op2.orm_modlist = qpw->rs_mods;
+ cb2.sc_private = qpw; /* let Modify know this was pwdMod,
+ * if it cares... */
rs->sr_err = slap_mods_opattrs( &op2, ml, qpw->rs_modtail, &rs->sr_text,
NULL, 0 );
}
}
slap_mods_free( qpw->rs_mods );
+ if ( rsp ) {
+ free( qpw->rs_new.bv_val );
+ }
return rs->sr_err;
}
}
void
-slap_passwd_hash(
- char *hash,
+slap_passwd_hash_type(
struct berval * cred,
struct berval * new,
+ char *hash,
const char **text )
{
new->bv_len = 0;
new->bv_val = NULL;
+ assert( hash );
+
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
ldap_pvt_thread_mutex_lock( &passwd_mutex );
#endif
#endif
}
+void
+slap_passwd_hash(
+ struct berval * cred,
+ struct berval * new,
+ const char **text )
+{
+ char *hash = NULL;
+ if ( default_passwd_hash ) {
+ hash = default_passwd_hash[0];
+ }
+ if ( !hash ) {
+ hash = (char *)defhash[0];
+ }
+
+ slap_passwd_hash_type( cred, new, hash, text );
+}
LDAP_SLAPD_F (int) overlay_register( slap_overinst *on );
LDAP_SLAPD_F (int) overlay_config( BackendDB *be, const char *ov );
+LDAP_SLAPD_F (slap_overinst *) overlay_next( slap_overinst *on );
/*
* ch_malloc.c
LDAP_SLAPD_F (int) connection_client_setup LDAP_P((
ber_socket_t s,
- Listener *l,
ldap_pvt_thread_start_t *func,
void *arg ));
LDAP_SLAPD_F (void) connection_client_enable LDAP_P(( ber_socket_t s ));
LDAP_SLAPD_F (void) connection_done LDAP_P((Connection *));
LDAP_SLAPD_F (void) connection2anonymous LDAP_P((Connection *));
+LDAP_SLAPD_F (void) connection_fake_init LDAP_P((
+ Connection *conn,
+ Operation *op,
+ void *threadctx ));
/*
* cr.c
LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index));
/*
- * * cancel.c
- * */
+ * cancel.c
+ */
LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) cancel_extop;
/*
LDAP_SLAPD_F (void) slap_passwd_generate( struct berval * );
LDAP_SLAPD_F (void) slap_passwd_hash(
- char *type,
struct berval *cred,
struct berval *hash,
const char **text );
+LDAP_SLAPD_F (void) slap_passwd_hash_type(
+ struct berval *cred,
+ struct berval *hash,
+ char *htype,
+ const char **text );
+
LDAP_SLAPD_F (struct berval *) slap_passwd_return(
struct berval *cred );