Topic
  • 4 replies
  • Latest Post - ‏2013-10-23T22:46:56Z by George Wilson
nasica88
nasica88
26 Posts

Pinned topic undefined reference to `ldap_get_lderrno'

‏2013-10-21T06:59:04Z |

A customer is working to compile an authentification solution on PowerLinux.  This solution is being used on AIX, and the customer says a LDAP library called libldapssl41.so provided the necessary functions on AIX.

Now the customer encountered the following message when compiling the solution on PowerLinux.

 

...undefined reference to `ldap_get_lderrno'

 

I did a search on my test PowerLinux machine, and found the following RPMs installed.

 

# rpm -qa | grep ldap
openldap-2.4.23-31.el6.ppc
mod_authz_ldap-0.26-16.el6.ppc64
pam_ldap-185-11.el6.ppc64
openldap-2.4.23-31.el6.ppc64
apr-util-ldap-1.3.9-3.el6_0.1.ppc64
php-ldap-5.3.3-22.el6.ppc64
openldap-servers-2.4.23-31.el6.ppc64
openldap-devel-2.4.23-31.el6.ppc64
krb5-server-ldap-1.10.3-10.el6.ppc64
nss-pam-ldapd-0.7.5-18.el6.ppc64
python-ldap-2.3.10-1.el6.ppc64
compat-openldap-2.3.43-2.el6.ppc64
openldap-clients-2.4.23-31.el6.ppc64
openldap-devel-2.4.23-31.el6.ppc

 

With these RPMs installed, I see the following libraries



# find / -name libldap*
/lib64/libldap_r-2.4.so.2.5.6
/lib64/libldap-2.4.so.2
/lib64/libldap_r-2.4.so.2
/lib64/libldap-2.4.so.2.5.6
/usr/lib64/libldap-2.3.so.0.2.31
/usr/lib64/libldap.so
/usr/lib64/evolution-openldap/lib64/libldap.a
/usr/lib64/evolution-openldap/lib64/libldap_r.a
/usr/lib64/libldap_r.so
/usr/lib64/libldap-2.3.so.0
/usr/lib64/libldap-2.4.so.2
/usr/lib64/libldap_r-2.3.so.0
/usr/lib64/libldap_r-2.4.so.2
/usr/lib64/libldap_r-2.3.so.0.2.31
/usr/lib/libldap.so
/usr/lib/evolution-openldap/lib/libldap.a
/usr/lib/evolution-openldap/lib/libldap_r.a
/usr/lib/libldap_r.so
/usr/lib/libldap-2.4.so.2
/usr/lib/libldap_r-2.4.so.2
/lib/libldap_r-2.4.so.2.5.6
/lib/libldap-2.4.so.2
/lib/libldap_r-2.4.so.2
/lib/libldap-2.4.so.2.5.6
 

I checked each of these with strings, but I could not find any which contained ldap_get_lderrno in it.  For example, I see that there are many "ldap_get_*" functions defined in /usr/lib64/libldap.so, but not ldap_get_lderrno.

 

# strings  /usr/lib64/libldap.so | grep ldap_get
ldap_get_message_ber
ldap_get_values
ldap_get_dn
ldap_get_dn_ber
ldap_get_entry_controls
ldap_get_attribute_ber
ldap_get_values_len
ldap_get_option
ldap_get_dn
ldap_get_dn_ber
ldap_get_dn
ldap_get_dn_ber
ldap_get_entry_controls
ldap_get_attribute_ber
ldap_get_attribute_ber
ldap_get_values_len
ldap_get_values
ldap_get_values_len
ldap_get_values
ldap_get_option
 

Which measure do I have to take to get over this error message ?  Any comment would be much appreciated.

 

  • NishAravamudan
    NishAravamudan
    12 Posts

    Re: undefined reference to `ldap_get_lderrno'

    ‏2013-10-22T00:09:31Z  

    From some quick googling, ldap_get_lderrno is provided by the Netscape LDAP library, which doesn't really appear to be available on Linux. It would appear that ld_errno access is not provided by any library function in OpenLDAP, but rather, per `man ld_errno`:

           The   code   associated  with  an  LDAP  session  is  accessible  using
           ldap_get_option(3) and ldap_set_option(3) with the LDAP_OPT_RESULT_CODE
           option (previously called LDAP_OPT_ERROR_NUMBER)

  • nasica88
    nasica88
    26 Posts

    Re: undefined reference to `ldap_get_lderrno'

    ‏2013-10-22T01:00:49Z  

    From some quick googling, ldap_get_lderrno is provided by the Netscape LDAP library, which doesn't really appear to be available on Linux. It would appear that ld_errno access is not provided by any library function in OpenLDAP, but rather, per `man ld_errno`:

           The   code   associated  with  an  LDAP  session  is  accessible  using
           ldap_get_option(3) and ldap_set_option(3) with the LDAP_OPT_RESULT_CODE
           option (previously called LDAP_OPT_ERROR_NUMBER)

    Which means the customer was using a non-standard-open-source-code LDAP product, I guess...

    Since the customer was using the same source code on AIX, I did a search on the cases of AIX.  I found the following sentences.

    ldap_init, ldap_set_option, ldap_get_lderrno and ldap_simple_bind functions are defined in libibmldap.a and libidsldap.a module.

    So, does that mean the customer has to use some kind of IBM LDAP product on PowerLinux to get his source code working ?

  • nasica88
    nasica88
    26 Posts

    Re: undefined reference to `ldap_get_lderrno'

    ‏2013-10-22T06:18:43Z  

    From some quick googling, ldap_get_lderrno is provided by the Netscape LDAP library, which doesn't really appear to be available on Linux. It would appear that ld_errno access is not provided by any library function in OpenLDAP, but rather, per `man ld_errno`:

           The   code   associated  with  an  LDAP  session  is  accessible  using
           ldap_get_option(3) and ldap_set_option(3) with the LDAP_OPT_RESULT_CODE
           option (previously called LDAP_OPT_ERROR_NUMBER)

    I found that libldapssl41.so is provided by 'Netscape LDAP SDK for C'.  

    Since Mozilla is similar to Netscape, I compiled mozila LDAP SDK, whose source code is available at ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v6.0.7/src/mozldap-6.0.7.tar.gz

    First, you need to install nspr-devel packages.

    [root@example c-sdk]# yum install nspr-devel.ppc nspr-devel.ppc64

    [root@example c-sdk]# yum list | grep nspr
    nspr.ppc                              4.9.2-1.el6              @rhel64-ppc.repo
    nspr.ppc64                            4.9.2-1.el6              @anaconda-RedHatEnterpriseLinux-201301301505.ppc64/6.4
    nspr-devel.ppc                        4.9.2-1.el6              @rhel64-ppc.repo
    nspr-devel.ppc64                      4.9.2-1.el6              @rhel64-ppc.repo

    Also, you need to midify four source codes from mozldap-6.0.7.tar.gz as below.  Basically, it is just modifying the locations of some header files.

    [root@example c-sdk]# vi /usr/include/nspr4/private/pprio.h

    #include <nspr4/prtypes.h>
    /*  #include "prtypes.h"  */
    #include <nspr4/prio.h>
    /*  #include "prio.h"  */

    [root@example c-sdk]# vi ./ldap/libraries/libprldap/ldappr-public.c

    #include <nspr4/private/pprio.h>
    /* #include <private/pprio.h> */

    [root@example c-sdk]# vi ./ldap/include/ldappr.h

    #include <nspr4/nspr.h>
    /*  #include "nspr.h"  */

    [root@example c-sdk]# vi ./ldap/libraries/libprldap/ldappr-int.h

    #include <nspr4/nspr.h>
    /*  #include "nspr.h"  */

    Then you are good to go.  It's just ./configure & make as usual. 

    [root@example c-sdk]# nm -X32_64 ./ldap/libraries/libldap/libldap60.so | grep ldap_get                  
    000000000000eedc t 00000010.plt_call.ldap_get_dn+0
    000000000000ec20 t 00000010.plt_call.ldap_get_lderrno+0
    000000000000f92c t 00000010.plt_call.ldap_get_values+0
    000000000000f698 t 00000010.plt_call.ldap_get_values_len+0
    000000000000e9c8 t 00000010.plt_call.ldap_getfilter_free+0
    000000000000eb30 t 00000010.plt_call.ldap_getfirstfilter+0
    000000000000f51c t 00000010.plt_call.ldap_getnextfilter+0
    0000000000052890 d internal_ldap_get_lang_values
    0000000000052880 d internal_ldap_get_values
    0000000000052760 D ldap_get_dn
    00000000000527b0 D ldap_get_entry_controls
    00000000000528b0 D ldap_get_lang_values
    00000000000528a0 D ldap_get_lang_values_len
    00000000000525d0 D ldap_get_lderrno
    0000000000052860 D ldap_get_option
    00000000000528d0 D ldap_get_values
    00000000000528c0 D ldap_get_values_len
    0000000000052680 D ldap_getfilter_free
    0000000000052830 D ldap_getfirstfilter
    0000000000052800 D ldap_getnextfilter

     

    I am waiting for the customer's test result.

     

     

    Updated on 2013-10-22T06:20:03Z at 2013-10-22T06:20:03Z by nasica88
  • George Wilson
    George Wilson
    2 Posts

    Re: undefined reference to `ldap_get_lderrno'

    ‏2013-10-23T22:46:56Z  

    Marcelo Cerri on the Linux Security Team suggested this:

    "It seems it's missing the IBM LDAP libraries which are installed with the IBM (Tivoli) Directory Server C-Client SDK:
    http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDS.doc_6.2/progref05.htm?path=7_12_0_9_3_25#errors"