static int msad_range_hack = 0;
+static int ad_count;
+
static Attr_option *ad_find_option_definition( const char *opt, int optlen );
int ad_keystring(
d2->ad_flags = desc.ad_flags;
d2->ad_cname.bv_len = desc.ad_type->sat_cname.bv_len;
d2->ad_tags.bv_len = desc.ad_tags.bv_len;
+ ldap_pvt_thread_mutex_lock( &ad_index_mutex );
+ d2->ad_index = ++ad_count;
+ ldap_pvt_thread_mutex_unlock( &ad_index_mutex );
if (dlen == 0) {
d2->ad_cname.bv_val = d2->ad_type->sat_cname.bv_val;
/* shouldn't we protect this for concurrency? */
desc->ad_type = at;
+ desc->ad_index = 0;
ldap_pvt_thread_mutex_lock( &ad_undef_mutex );
desc->ad_next = desc->ad_type->sat_ad;
desc->ad_type->sat_ad = desc;
#define gmtime_mutex ldap_int_gmtime_mutex
#endif /* ! LDAP_DEVEL */
+LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) ad_index_mutex;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) ad_undef_mutex;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) oc_undef_mutex;
unsigned int index_intlen_strlen = SLAP_INDEX_INTLEN_STRLEN(
SLAP_INDEX_INTLEN_DEFAULT );
+ldap_pvt_thread_mutex_t ad_index_mutex;
ldap_pvt_thread_mutex_t ad_undef_mutex;
ldap_pvt_thread_mutex_t oc_undef_mutex;
syn_destroy();
if( schema_init_done ) {
+ ldap_pvt_thread_mutex_destroy( &ad_index_mutex );
ldap_pvt_thread_mutex_destroy( &ad_undef_mutex );
ldap_pvt_thread_mutex_destroy( &oc_undef_mutex );
}
slap_at_proxied.sat_syntax = slap_schema.si_syn_octetString;
slap_schema.si_at_proxied = &slap_at_proxied;
+ ldap_pvt_thread_mutex_init( &ad_index_mutex );
ldap_pvt_thread_mutex_init( &ad_undef_mutex );
ldap_pvt_thread_mutex_init( &oc_undef_mutex );
#define SLAP_DESC_BINARY 0x01U
#define SLAP_DESC_TAG_RANGE 0x80U
#define SLAP_DESC_TEMPORARY 0x1000U
+ unsigned ad_index;
};
/* flags to slap_*2undef_ad to register undefined (0, the default)