#47570 slapi_ldap_init unusable during independent plugin development
Closed: Fixed None Opened 6 years ago by beall.

Due to the uninitialized interaction_table_mutex in snmp_collator.c, slapi_ldap_init cannot be called when linked into an independent executable.

Independent development would be good to remain available without having to switch APIs to use regular ldap_initialize, and also so as to not confuse other developers if they try something like this.

The following hack compiled into libslapd.so allows the above development to work properly. Some other way of doing this properly should probably be considered.

diff ~/Downloads/389-ds-base- ~/Downloads/389-ds-base-

if (! interaction_table_mutex) interaction_table_mutex = PR_NewLock();

RFE: making slapi_ldap_init callable without snmp_collator_init.
The api slapi_ldap_init calls set_snmp_interaction_row, in which
interaction_table_mutex is held. This patch replaces NSPR PR_(Un)Lock with
slapi_(un)lock_mutex. The slapi_(un)lock_mutex skips locking if the mutex
is not initialized.

Reviewed by Rich (Thank you!!)

Pushed to master:
4db4a0e..03533f2 master -> master
commit 03533f2

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.3 - 1/14 (January)

3 years ago

Login to comment on this ticket.