mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
mutex-protect "undefined" attribute descriptions/objectClasses addition (ITS#3958)
This commit is contained in:
parent
a3554aad3a
commit
de90dbbc52
@ -737,9 +737,12 @@ int slap_bv2undef_ad(
|
|||||||
/* canonical to upper case */
|
/* canonical to upper case */
|
||||||
ldap_pvt_str2upper( desc->ad_cname.bv_val );
|
ldap_pvt_str2upper( desc->ad_cname.bv_val );
|
||||||
|
|
||||||
desc->ad_type = slap_schema.si_at_undefined;
|
/* shouldn't we protect this for concurrency? */
|
||||||
|
desc->ad_type = at;
|
||||||
|
ldap_pvt_thread_mutex_lock( &ad_undef_mutex );
|
||||||
desc->ad_next = desc->ad_type->sat_ad;
|
desc->ad_next = desc->ad_type->sat_ad;
|
||||||
desc->ad_type->sat_ad = desc;
|
desc->ad_type->sat_ad = desc;
|
||||||
|
ldap_pvt_thread_mutex_unlock( &ad_undef_mutex );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !*ad ) {
|
if( !*ad ) {
|
||||||
|
@ -227,7 +227,9 @@ oc_bvfind_undef( struct berval *ocname )
|
|||||||
AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len );
|
AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len );
|
||||||
|
|
||||||
LDAP_STAILQ_NEXT( oc, soc_next ) = NULL;
|
LDAP_STAILQ_NEXT( oc, soc_next ) = NULL;
|
||||||
|
ldap_pvt_thread_mutex_lock( &oc_undef_mutex );
|
||||||
LDAP_STAILQ_INSERT_HEAD( &oc_undef_list, oc, soc_next );
|
LDAP_STAILQ_INSERT_HEAD( &oc_undef_list, oc, soc_next );
|
||||||
|
ldap_pvt_thread_mutex_unlock( &oc_undef_mutex );
|
||||||
|
|
||||||
return oc;
|
return oc;
|
||||||
}
|
}
|
||||||
|
@ -1704,6 +1704,9 @@ LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) replog_mutex;
|
|||||||
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) gmtime_mutex;
|
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) gmtime_mutex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) ad_undef_mutex;
|
||||||
|
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) oc_undef_mutex;
|
||||||
|
|
||||||
LDAP_SLAPD_V (ber_socket_t) dtblsize;
|
LDAP_SLAPD_V (ber_socket_t) dtblsize;
|
||||||
|
|
||||||
LDAP_SLAPD_V (int) use_reverse_lookup;
|
LDAP_SLAPD_V (int) use_reverse_lookup;
|
||||||
|
@ -79,6 +79,9 @@ unsigned int index_substr_if_maxlen = SLAP_INDEX_SUBSTR_IF_MAXLEN_DEFAULT;
|
|||||||
unsigned int index_substr_any_len = SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT;
|
unsigned int index_substr_any_len = SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT;
|
||||||
unsigned int index_substr_any_step = SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT;
|
unsigned int index_substr_any_step = SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT;
|
||||||
|
|
||||||
|
ldap_pvt_thread_mutex_t ad_undef_mutex;
|
||||||
|
ldap_pvt_thread_mutex_t oc_undef_mutex;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
inValidate(
|
inValidate(
|
||||||
Syntax *syntax,
|
Syntax *syntax,
|
||||||
@ -3966,4 +3969,7 @@ schema_destroy( void )
|
|||||||
mr_destroy();
|
mr_destroy();
|
||||||
mru_destroy();
|
mru_destroy();
|
||||||
syn_destroy();
|
syn_destroy();
|
||||||
|
|
||||||
|
ldap_pvt_thread_mutex_destroy( &ad_undef_mutex );
|
||||||
|
ldap_pvt_thread_mutex_destroy( &oc_undef_mutex );
|
||||||
}
|
}
|
||||||
|
@ -1143,6 +1143,12 @@ slap_schema_load( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slap_at_undefined.sat_syntax = slap_schema.si_syn_octetString;
|
||||||
|
slap_schema.si_at_undefined = &slap_at_undefined;
|
||||||
|
|
||||||
|
ldap_pvt_thread_mutex_init( &ad_undef_mutex );
|
||||||
|
ldap_pvt_thread_mutex_init( &oc_undef_mutex );
|
||||||
|
|
||||||
for( i=0; ad_map[i].ssam_name; i++ ) {
|
for( i=0; ad_map[i].ssam_name; i++ ) {
|
||||||
assert( ad_map[i].ssam_defn != NULL );
|
assert( ad_map[i].ssam_defn != NULL );
|
||||||
{
|
{
|
||||||
@ -1313,9 +1319,6 @@ slap_schema_load( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slap_at_undefined.sat_syntax = slap_schema.si_syn_octetString;
|
|
||||||
slap_schema.si_at_undefined = &slap_at_undefined;
|
|
||||||
|
|
||||||
return LDAP_SUCCESS;
|
return LDAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user