[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: AI_ADDRCONFIG in libldap/os-ip.c on solaris9



 Igor Brezac <igor@ipass.net> 08/15/04 05:32am
>
>On Sat, 14 Aug 2004, Quanah Gibson-Mount wrote:
>
>>
>>
>> --On Saturday, August 14, 2004 11:32 PM +0200 Mike O'Rourke 
>> <mjoop@curia.op.org> wrote:
>>
>>> Hi all,
>>> 
>>> I am compiling OpenLDAP 2.2.15 on Solaris 9. When I run 'make
test',
>>> the first test fails with 'ldap_bind: Can't contact LDAP server
(-1)'.
>>
>
>This is just a guess, but if you compiled OpenLDAP with the tcp
wrapper 
>support, add slapd entry in hosts.allow for localhost (127.0.0.1).  If
you 
>share you build procedure and test logs, we might be able to help you

>better.
>
OK ... but pardon the post's length.

my build environment
gcc is gcc-3 (gcc 3.3.2) from SUN's Software Companion CD which I
downloaded in August 2004
bind is bind9.2.4rc6 (compiled locally)
BerkeleyDB is 4.2.52 with the 2 patches (compiled locally)
SASL is 2.1.19 (compiled locally)
SSL is OpenSSL 0.9.7d (compiled locally)

('export' lines wrapped for readability)
export CFLAGS="-I/usr/local/bind/include 
    -I/usr/local/BerkeleyDB.4.2/include 
    -I/usr/local/ssl/include
    -I/opt/sfw/gcc-3/include
    -I/usr/local/include/sasl"
export CPPFLAGS="-I/usr/local/bind/include
    -I/usr/local/BerkeleyDB.4.2/include
    -I/usr/local/ssl/include
    -I/opt/sfw/gcc-3/include
    -I/usr/local/include/sasl"
export LDFLAGS="-L/usr/local/lib
    -L/usr/local/BerkeleyDB.4.2/lib
    -L/usr/local/ssl/lib
    -L/usr/local/lib/sasl2
    -L/opt/sfw/gcc-3/lib"
export LIBS="-R /opt/sfw/gcc-3/lib:
    /usr/local/BerkeleyDB.4.2/lib:
    /usr/local/ssl/lib:
    /usr/local/lib -ldb-4.2
    -lssl -lsocket -lnsl -lrt -lbind"
./configure --enable-debug --enable-ipv6 --with-cyrus-sasl \
   --without-kerberos --with-tls --enable-slapd --enable-cleartext \
   --enable-crypt --enable-spasswd --enable-bdb --enable-slurpd

The make does not give any errors (or warnings for that fact).

The "make test" yeilds:
   from tests/testrun/slapd.1.log:
       nothing about any attempted connections or any problems
   from tests/testrun/ldapsearch.out:
       ldap_bind: Can't contact LDAP server (-1)

running the server and client manually from the tests directory
yeilds:
(lines wrapped for readability)
   server: ../servers/slapd/slapd -s0 -f ./testrun/slapd.1.conf \
                   -h ldap://localhost:9011/ -d 9
(output omitted as it seems irrelevant here and, of course quite
lengthy)
   client: ../clients/tools/ldapsearch -P 3 -x -LLL -b "" -s base \
                   -h localhost -p 9011 -d 9 +extensibleObject
       ldap_create
       ldap_url_parse_ext(ldap://localhost:9011)
       ldap_bind_s
       ldap_simple_bind_s
       ldap_sasl_bind_s
       ldap_sasl_bind
       ldap_send_initial_request
       ldap_new_connection
       ldap_int_open_connection
       ldap_connect_to_host: TCP localhost:9011
       ldap_connect_to_host: getaddrinfo failed: invalid ai_flags
       ldap_perror
       ldap_bind: Can't contact LDAP server (-1)

The _only_ places where ai_flags appears in the source code (at least
in the *.c and *.h files) is in:
  libraries/libldap/os-ip.c
  libraries/libldap/util-int.c (in an error message)
  libraries/libldap_r/os-ip.c
  libraries/libldap_r/util-int.c (in the same error message)

In the os-ip.c code, there is an #ifdef AI_ADDRCONFIG, which on SUNv9
is defined in netdb.h, but simply is _not_ a valid flag for the ai_flags
member of the addrinfo structure, which is where this #ifdef tries to
use it.

Incidently, (and not suprisingly) leaving out "--enable-ipv6" of the
above build has no effect on this problem.

>> I generally advise against using Solaris 9.  Sun changed the
threading 
>> structure between Solaris 8 and Solaris 9.  My experiments with
OpenLDAP 
>> found that it is much more responsive and stable when used with
Solaris 8.
>
>In my testing I found virtually no difference between Solaris 8 and 9.

>Actually Solaris 9 performed better for me, I presume because of 
>improved file system and networking performance.  I've run OpenLDAP 
>(various versions including 2.2.15) on Solaris 9 for several years in
a 
>very busy environment without performance or stability issues.
>
>-- 
>Igor

Mike.