mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
ITS#9302 fix pwdFailireTime mutex scope
This commit is contained in:
parent
0e675be7ef
commit
138c492696
@ -57,6 +57,7 @@ typedef struct pp_info {
|
||||
int forward_updates; /* use frontend for policy state updates */
|
||||
int disable_write;
|
||||
int send_netscape_controls; /* send netscape password controls */
|
||||
ldap_pvt_thread_mutex_t pwdFailureTime_mutex;
|
||||
} pp_info;
|
||||
|
||||
/* Our per-connection info - note, it is not per-instance, it is
|
||||
@ -414,7 +415,6 @@ static char *pwd_ocs[] = {
|
||||
};
|
||||
|
||||
static ldap_pvt_thread_mutex_t chk_syntax_mutex;
|
||||
static ldap_pvt_thread_mutex_t pwdFailureTime_mutex;
|
||||
|
||||
enum {
|
||||
PPOLICY_DEFAULT = 1,
|
||||
@ -1419,13 +1419,13 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
|
||||
goto locked;
|
||||
}
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &pwdFailureTime_mutex );
|
||||
ldap_pvt_thread_mutex_lock( &pi->pwdFailureTime_mutex );
|
||||
op->o_bd->bd_info = (BackendInfo *)on->on_info;
|
||||
rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &e );
|
||||
op->o_bd->bd_info = bi;
|
||||
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
ldap_pvt_thread_mutex_unlock( &pwdFailureTime_mutex );
|
||||
ldap_pvt_thread_mutex_unlock( &pi->pwdFailureTime_mutex );
|
||||
return SLAP_CB_CONTINUE;
|
||||
}
|
||||
|
||||
@ -1784,7 +1784,7 @@ locked:
|
||||
op->o_callback->sc_cleanup = ppolicy_ctrls_cleanup;
|
||||
}
|
||||
op->o_bd->bd_info = bi;
|
||||
ldap_pvt_thread_mutex_unlock( &pwdFailureTime_mutex );
|
||||
ldap_pvt_thread_mutex_unlock( &pi->pwdFailureTime_mutex );
|
||||
return SLAP_CB_CONTINUE;
|
||||
}
|
||||
|
||||
@ -3119,6 +3119,7 @@ ppolicy_db_init(
|
||||
)
|
||||
{
|
||||
slap_overinst *on = (slap_overinst *) be->bd_info;
|
||||
pp_info *pi;
|
||||
|
||||
if ( SLAP_ISGLOBALOVERLAY( be ) ) {
|
||||
/* do not allow slapo-ppolicy to be global by now (ITS#5858) */
|
||||
@ -3130,7 +3131,7 @@ ppolicy_db_init(
|
||||
return 1;
|
||||
}
|
||||
|
||||
on->on_bi.bi_private = ch_calloc( sizeof(pp_info), 1 );
|
||||
pi = on->on_bi.bi_private = ch_calloc( sizeof(pp_info), 1 );
|
||||
|
||||
if ( !pwcons ) {
|
||||
/* accommodate for c_conn_idx == -1 */
|
||||
@ -3140,7 +3141,7 @@ ppolicy_db_init(
|
||||
|
||||
ov_count++;
|
||||
|
||||
ldap_pvt_thread_mutex_init( &pwdFailureTime_mutex );
|
||||
ldap_pvt_thread_mutex_init( &pi->pwdFailureTime_mutex );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3183,6 +3184,7 @@ ppolicy_db_destroy(
|
||||
pp_info *pi = on->on_bi.bi_private;
|
||||
|
||||
on->on_bi.bi_private = NULL;
|
||||
ldap_pvt_thread_mutex_destroy( &pi->pwdFailureTime_mutex );
|
||||
free( pi->def_policy.bv_val );
|
||||
free( pi );
|
||||
|
||||
@ -3193,7 +3195,6 @@ ppolicy_db_destroy(
|
||||
pwc--;
|
||||
ch_free( pwc );
|
||||
}
|
||||
ldap_pvt_thread_mutex_destroy( &pwdFailureTime_mutex );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user