cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl 7.19.6 CMakeLists.txt patch

From: Cosmin Luță <cosmin.luta_at_avira.com>
Date: Thu, 15 Oct 2009 14:35:22 +0300

Hi,

I noticed two issues regarding LDAP in curl's 7.19.6 CMakeLists.txt
(they probably apply to older versions too).

First issue: setting HTTP_ONLY does not disable LDAPS. I'm not sure
if that's disabled automatically by CURL_DISABLE_LDAP (I didn't study
the CMakeLists.txt files too carefully):

if(HTTP_ONLY)
  set(CURL_DISABLE_FTP ON)
  set(CURL_DISABLE_LDAP ON)
  set(CURL_DISABLE_LDAPS ON) # <--- this line is missing!
  set(CURL_DISABLE_TELNET ON)
  set(CURL_DISABLE_DICT ON)
  set(CURL_DISABLE_FILE ON)
  set(CURL_DISABLE_TFTP ON)
endif()

Second issue: disabling LDAP support (CURL_DISABLE_LDAP and
CURL_DISABLE_LDAPS) still links libcurl.so against libldap (if it's
found on the system).

This is the libcurl.so compiled with CURL_DISABLE_{LDAP,LDAPS}.

% ldd libcurl.so
        linux-gate.so.1 => (0xb80b0000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb803e000)
        libcrypto.so.0.9.8 => /lib/i686/cmov/libcrypto.so.0.9.8
(0xb7ef2000) libssl.so.0.9.8 => /lib/i686/cmov/libssl.so.0.9.8
(0xb7eaa000) libidn.so.11 => /usr/lib/libidn.so.11 (0xb7e77000)
        libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb7e33000)
        libz.so.1 => /lib/libz.so.1 (0xb7e1d000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
(0xb7e04000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7ca1000)
        /lib/ld-linux.so.2 (0xb80b1000)
        liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb7c92000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7c7a000)
        libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7c64000)
        libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0xb7bc7000)
        libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb7bb5000)
        libgcrypt.so.11 => /lib/libgcrypt.so.11 (0xb7b4b000)
        libgpg-error.so.0 => /lib/libgpg-error.so.0 (0xb7b47000)

The problem is caused by this piece of code which adds the ldap library
to the link libraries regardless if LDAP support is wanted or not:

# Check for LDAP
check_library_exists_concat("ldap" ldap_init HAVE_LIBLDAP)
# if(NOT HAVE_LIBLDAP)
# SET(CURL_DISABLE_LDAP ON)
# endif(NOT HAVE_LIBLDAP)

This is the output of ldd on a version built with the attached patch:
% ldd libcurl.so
        linux-gate.so.1 => (0xb7f98000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f26000)
        libcrypto.so.0.9.8 => /lib/i686/cmov/libcrypto.so.0.9.8
(0xb7dda000) libssl.so.0.9.8 => /lib/i686/cmov/libssl.so.0.9.8
(0xb7d92000) libidn.so.11 => /usr/lib/libidn.so.11 (0xb7d5f000)
        libz.so.1 => /lib/libz.so.1 (0xb7d49000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
(0xb7d30000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7bcd000)
        /lib/ld-linux.so.2 (0xb7f99000)

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2009-10-15