tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libldap/libldap_r confusion (was: radiusd: Error detected by libpthread: Invalid mutex.)

> Using 2 copies of the library is asking for trouble.
Yes, the problem is the following:

radiusd calls initgroups() from the C library.
That, by /etc/nsswitch.conf, dynamically loads nss_ldap.
nss_ldap pulls in libldap (not libldap_r).
Later, radiusd dynamically loads rlm_ldap.
rlm_ldap pulls in libldap_r.
Later, nss_ldap, via PLT, calls ldap_ld_free(). Being linked against libldap,
it expects to call the libldap version of ldap_ld_free().
However, since the dynamic linker, in the meantime, has loaded libldap_r,
it resolves that PLT entry to the libldap_r version of ldap_ld_free().

My impression is that this is fundamentally broken and cannot easily be fixed.
We can link nss_ldap against libldap_r, but then some program may later pull in
libldap, and we get the same mess the other way round.

Home | Main Index | Thread Index | Old Index