FreeBSD 4.3 LDAP Authentication to OpenLDAP ver2 Servers

FreeBSD 4.3 LDAP Authentication to OpenLDAP ver2 Servers

Post by Rory Sava » Sat, 22 Sep 2001 05:51:00



I've posted a number of messages on the newsgroup, and I have done many
hours of reaseach and hacking to try and get FreeBSD 4.3 to authenticate
to my LDAP v2 server, but have been unsuccessful.  What I see on the
newsgroups are people in my situation, who seem to know what the right
direction is, but run into compiling errors.  Some say they actually have
gotten this to work, but never, ever leave useful instrustions behind.
They just seem to leave ``clues'', and therefore get others lost in the
process.
From what I understand, there are ``two'' paths one could take to get this
working.  The first path is what I call the ``nectar'' path, mean involces
installing OpenLDAP, LDAPSDK, BIND8 (IRS ?  what is that), pam_ldap,
nss_ldap from nectar.com (which doesn't exist anymore), and then applying
patches.  But from attempting to do this, you also find out they are
talking about FreeBSD 5.0 (-Current).  Which is no good for me, since I do

not plan to run beta software in my production servers, so for practical
reason this leaves me with path #2 which I call ``padl-nss''.  Now, the
padl-nss path seems like it should work, and run very well without
problems, yet this isn't the case either.
        PADL NSS_LDAP Aporoach ::

        1. Fresh clean install of FreeBSD 4.3-Release
        2. install ports, bash2, ncftp, unzip, bzip2, libiconv,
           gettext-0.10.85, gmake, db3, cyrus-sasl, bind8 (IRS ???),
           ldapsdk, openldap 2.0.11, pam_ldap from padl.com, and nss_ldap
           from padl.com as well.

        3. Not all of 2. will compile with out problems, especially
           pam_ldap, and nss_ldap.  The pam_ldap will compile if you
           sym-link most of the ldap libraries from /usr/local/lib
           to /usr/lib, and the includes from /usr/local/include to
           /usr/include. But, trying to get any version of nss_ldap to
           complie in FreeBSD is a big nitemare, I get two diffrent kinds
           of output, if I do a simple, ./configure, and then make,
           here is the output;

           Output from ./configure
                checking for bits/libc-lock.h...
                (cached) no
                checking for main in -lresolv... (cached) no
                checking for main in -lnsl... (cached) no
                checking for strtok_r... (cached) yes
                checking for sigset... (cached) no
                checking for res_search... (cached) yes
                checking for dn_expand... (cached) yes
                checking for snprintf... (cached) yes
                checking for dlopen in -ldl... (cached) no
                checking for main in -ldb... (cached) yes
                checking for main in -llber... (cached) yes
                checking for main in -lldap... (cached) yes
                checking for ldap_init... (cached) yes
                checking for ldap_get_lderrno... (cached) no
                checking for ldap_parse_result... (cached) yes
                checking for ldap_memfree... (cached) yes
                checking for ldap_controls_free... (cached) yes
                checking for ldap_ld_free... (cached) yes
                checking for ldap_explode_rdn... (cached) yes
                checking for ldap_set_option... (cached) yes
                checking for ldap_get_option... (cached) yes
                checking for ldapssl_client_init... (cached) no
                checking for ldap_start_tls_s... (cached) yes
                checking for ldap_pvt_tls_set_option... (cached) yes
                checking for ldap_initialize... (cached) yes
                checking for gethostbyname_r... (cached) no
                checking for ldap_set_rebind_proc... (cached) yes
                checking for gethostbyname... (cached) yes
                checking for nsdispatch... (cached) no
                checking for pthread_atfork... (cached) no
               checking for dlopen in -ldl... (cached) no
                checking for main in -ldb... (cached) yes
                checking for main in -llber... (cached) yes
                checking for main in -lldap... (cached) yes
                checking for ldap_init... (cached) yes
                checking for ldap_get_lderrno... (cached) no
                checking for ldap_parse_result... (cached) yes
                checking for ldap_memfree... (cached) yes
                checking for ldap_controls_free... (cached) yes
                checking for ldap_ld_free... (cached) yes
                checking for ldap_explode_rdn... (cached) yes
                checking for ldap_set_option... (cached) yes
                checking for ldap_get_option... (cached) yes
                checking for ldapssl_client_init... (cached) no
                checking for ldap_start_tls_s... (cached) yes
                checking for ldap_pvt_tls_set_option... (cached) yes
                checking for ldap_initialize... (cached) yes
                checking for gethostbyname_r... (cached) no
                checking for ldap_set_rebind_proc... (cached) yes
               checking whether ldap_set_rebind_proc takes 3 arguments... (cached) 2
                updating cache ./config.cache
                creating ./config.status
                creating Makefile
                creating config.h
                config.h is unchanged

        Output from make
                gcc -DHAVE_CONFIG_H -I. -I. -I.   -DLDAP_REFERRALS -DPIC
-D_REENTRANT  -g -O2 -Wall -fPIC -c ld
ap-nss.c
In file included from ldap-nss.c:77:
ldap-nss.h:441: syntax error before `*'
ldap-nss.h:442: warning: type defaults to `int' in declaration of
`NSS_STATUS'
ldap-nss.h:442: `NSS_STATUS' declared as function returning a function
ldap-nss.h:502: `_nss_ldap_search_s' declared as function returning a
function
ldap-nss.h:511: `_nss_ldap_search' declared as function returning a
function
ldap-nss.h:516: `_nss_ldap_result' declared as function returning a
function
ldap-nss.h:523: `_nss_ldap_read' declared as function returning a function
ldap-nss.h:535: syntax error before `parser_t'
ldap-nss.h:535: `_nss_ldap_getent' declared as function returning a
function
ldap-nss.h:547: syntax error before `parser_t'
ldap-nss.h:547: `_nss_ldap_getbyname' declared as function returning a
function
ldap-nss.h:557: `_nss_ldap_assign_attrvals' declared as function returning
a function
ldap-nss.h:564: `_nss_ldap_assign_attrval' declared as function returning
a function
ldap-nss.h:572: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.h:574: `_nss_ldap_oc_check' declared as function returning a
function
In file included from ldap-nss.c:80:
util.h:41: `_nss_ldap_getrdnvalue' declared as function returning a
function
util.h:49: `_nss_ldap_dn2uid' declared as function returning a function
util.h:113: `_nss_ldap_readconfig' declared as function returning a
function
util.h:120: `_nss_ldap_escape_string' declared as function returning a
function
In file included from ldap-nss.c:81:
dnsconfig.h:29: `_nss_ldap_getdnsdn' declared as function returning a
function
dnsconfig.h:32: `_nss_ldap_readconfigfromdns' declared as function
returning a function
ldap-nss.c:178: `do_open' declared as function returning a function
ldap-nss.c:197: `do_result' declared as function returning a function
ldap-nss.c:205: `do_filter' declared as function returning a function
ldap-nss.c:212: syntax error before `parser_t'
ldap-nss.c:212: `do_parse' declared as function returning a function
ldap-nss.c:219: syntax error before `parser_t'
ldap-nss.c:219: `do_parse_s' declared as function returning a function
ldap-nss.c:235: `do_with_reconnect' declared as function returning a
function
ldap-nss.c:523: `do_open' declared as function returning a function
ldap-nss.c: In function `do_open':
ldap-nss.c:727: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:727: (Each undeclared identifier is reported only once
ldap-nss.c:759: invalid lvalue in assignment
ldap-nss.c:766: invalid lvalue in assignment
ldap-nss.c:773: warning: return makes integer from pointer without a cast
ldap-nss.c:837: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1019: warning: control reaches end of non-void function
ldap-nss.c: In function `_nss_ldap_ent_context_init':
ldap-nss.c:1196: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c: In function `_nss_ldap_ent_context_release':
ldap-nss.c:1237: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c: At top level:
ldap-nss.c:1257: `do_filter' declared as function returning a function
ldap-nss.c: In function `do_filter':
ldap-nss.c:1286: invalid lvalue in assignment
ldap-nss.c:1286: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1287: warning: return makes integer from pointer without a cast
ldap-nss.c:1298: invalid lvalue in assignment
ldap-nss.c:1301: invalid lvalue in assignment
ldap-nss.c:1302: warning: return makes integer from pointer without a cast
ldap-nss.c:1309: invalid lvalue in assignment
ldap-nss.c:1310: warning: return makes integer from pointer without a cast
ldap-nss.c:1355: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:1363: `do_result' declared as function returning a function
ldap-nss.c: In function `do_result':
ldap-nss.c:1365: function `stat' is initialized like a variable
ldap-nss.c:1365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1401: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1404: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1430: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1455: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1466: `do_with_reconnect' declared as function returning a
function
ldap-nss.c: In function `do_with_reconnect':
ldap-nss.c:1468: function `stat' is initialized like a variable
ldap-nss.c:1468: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1493: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1520: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1535: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1540: switch quantity not an integer
ldap-nss.c:1543: warning: unreachable code at beginning of switch
statement
ldap-nss.c:1565: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1661: syntax error before `parser_t'
ldap-nss.c:1662: `do_parse' declared as function returning a function
ldap-nss.c: In function `do_parse':
ldap-nss.c:1663: function `parseStat' is initialized like a variable
ldap-nss.c:1663: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1676: function `resultStat' is initialized like a variable
ldap-nss.c:1676: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1678: `ctx' undeclared (first use in this function)
ldap-nss.c:1682: invalid lvalue in assignment
ldap-nss.c:1688: invalid lvalue in assignment
ldap-nss.c:1702: warning: implicit declaration of function `parser'
ldap-nss.c:1702: `result' undeclared (first use in this function)
ldap-nss.c:1703: `buffer' undeclared (first use in this function)
ldap-nss.c:1703: `buflen' undeclared (first use in this function)
ldap-nss.c:1703: invalid lvalue in assignment
ldap-nss.c:1706: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1720: `errnop' undeclared (first use in this function)
ldap-nss.c:1733: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1741: syntax error before `parser_t'
ldap-nss.c:1742: `do_parse_s' declared as function returning a function
ldap-nss.c: In function `do_parse_s':
ldap-nss.c:1743: function `parseStat' is initialized like a variable
ldap-nss.c:1743: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1757: `ctx' undeclared (first use in this function)
ldap-nss.c:1784: `result' undeclared (first use in this function)
ldap-nss.c:1784: `buffer' undeclared (first use in this function)
ldap-nss.c:1784: `buflen' undeclared (first use in this function)
ldap-nss.c:1784: invalid lvalue in assignment
ldap-nss.c:1787: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1791: `errnop' undeclared (first use in this function)
ldap-nss.c:1804: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1814: `_nss_ldap_read' declared as function returning a
function
ldap-nss.c:1881: `_nss_ldap_result' declared as function returning a
function
ldap-nss.c:1894: `_nss_ldap_search_s' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_search_s':
ldap-nss.c:1904: invalid lvalue in assignment
ldap-nss.c:1905: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1909: warning: return makes integer from pointer without a cast
ldap-nss.c:1944: invalid lvalue in assignment
ldap-nss.c:1946: warning: return makes integer from pointer without a cast
ldap-nss.c:1950: invalid lvalue in assignment
ldap-nss.c:1954: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1965: `_nss_ldap_search' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_search':
ldap-nss.c:1975: invalid lvalue in assignment
ldap-nss.c:1976: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1980: warning: return makes integer from pointer without a cast
ldap-nss.c:2016: invalid lvalue in assignment
ldap-nss.c:2018: warning: return makes integer from pointer without a cast
ldap-nss.c:2022: invalid lvalue in assignment
ldap-nss.c:2026: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2043: syntax error before `parser_t'
ldap-nss.c:2044: `_nss_ldap_getent' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_getent':
ldap-nss.c:2045: function `stat' is initialized like a variable
ldap-nss.c:2045: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2049: `ctx' undeclared (first use in this function)
ldap-nss.c:2058: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:2077: `filterprot' undeclared (first use in this function)
ldap-nss.c:2077: `sel' undeclared (first use in this function)
ldap-nss.c:2077: invalid lvalue in assignment
ldap-nss.c:2082: warning: return makes integer from pointer without a cast
ldap-nss.c:2091: `result' undeclared (first use in this function)
ldap-nss.c:2091: `buffer' undeclared (first use in this function)
ldap-nss.c:2091: `buflen' undeclared (first use in this function)
ldap-nss.c:2091: `errnop' undeclared (first use in this function)
ldap-nss.c:2091: `parser' undeclared (first use in this function)
ldap-nss.c:2091: invalid lvalue in assignment
ldap-nss.c:2095: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2109: syntax error before `parser_t'
ldap-nss.c:2110: `_nss_ldap_getbyname' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_getbyname':
ldap-nss.c:2111: function `stat' is initialized like a variable
ldap-nss.c:2120: `args' undeclared (first use in this function)
ldap-nss.c:2120: `filterprot' undeclared (first use in this function)
ldap-nss.c:2120: `sel' undeclared (first use in this function)
ldap-nss.c:2120: invalid lvalue in assignment
ldap-nss.c:2121: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2125: warning: return makes integer from pointer without a cast
ldap-nss.c:2138: `result' undeclared (first use in this function)
ldap-nss.c:2138: `buffer' undeclared (first use in this function)
ldap-nss.c:2138: `buflen' undeclared (first use in this function)
ldap-nss.c:2138: `errnop' undeclared (first use in this function)
ldap-nss.c:2138: `parser' undeclared (first use in this function)
ldap-nss.c:2138: invalid lvalue in assignment
ldap-nss.c:2147: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2166: `_nss_ldap_assign_attrvals' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_attrvals':
ldap-nss.c:2186: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2200: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2247: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2255: `_nss_ldap_assign_attrval' declared as function returning
a function
ldap-nss.c: In function `_nss_ldap_assign_attrval':
ldap-nss.c:2262: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2269: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2282: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2283: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2294: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_userpassword':
ldap-nss.c:2365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2138: `result' undeclared (first use in this function)
ldap-nss.c:2138: `buffer' undeclared (first use in this function)
ldap-nss.c:2138: `buflen' undeclared (first use in this function)
ldap-nss.c:2138: `errnop' undeclared (first use in this function)
ldap-nss.c:2138: `parser' undeclared (first use in this function)
ldap-nss.c:2138: invalid lvalue in assignment
ldap-nss.c:2147: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2166: `_nss_ldap_assign_attrvals' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_attrvals':
ldap-nss.c:2186: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2200: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2247: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2255:ldap-nss.c: In function `_nss_ldap_assign_attrval':
ldap-nss.c:2262: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2269: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2282: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2283: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2294: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_userpassword':
ldap-nss.c:2365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2382: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2383: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2387: `_nss_ldap_oc_check' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_oc_check':
ldap-nss.c:2389: function `ret' is initialized like a variable
 `_nss_ldap_assign_attrval' declared as function returning
a functionldap-nss.c: In function `_nss_ldap_assign_attrval':
ldap-nss.c:2262: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2269: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2282: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2283: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2294: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_userpassword':
ldap-nss.c:2365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2382: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2383: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2387: `_nss_ldap_oc_check' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_oc_check':
ldap-nss.c:2389: function `ret' is initialized like a variable
ldap-nss.c:2389: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2398: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2409: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:21: warning: `rcsId' defined but not used
*** Error code 1

Stop in /usr/ldap/src/nss_ldap-172.

So, so if you read the INSTALL file which comes with nss_ldap, there is a
section in there that says the author had to issue these enviornment vars,
to get the compiling to work

CPPFLAGS="-I/usr/local/include -I/usr/local/include/bind -DPIC"
export CPPFLAGS
CFLAGS=$CPPFLAGS # this is weird
export CFLAGS
LDFLAGS="-L/usr/lib"
LIBS="-lbind_r -lgnuregex -lsasl -lkrb"
export LDFLAGS LIBS

Let's take a look at this for grins :)

CPPFLAGS="-I/usr/local/include -I/usr/local/include/bind -DPIC"
   ^^ I have my includes in /usr/local/include and /usr/include, I also
      install BIND8 to /usr/local/include/bind, so this should work
LDFLAGS="-L/usr/lib"
   ^^ Looks noraml enough
LIBS="-lbind_r -lgnuregex -lsasl -lkrb"
   ^^ I do not use kerberos, and it's not installed/configured by default
      in FreeBSD, but should be ok, I see no wring adding this item in to
      LIBS.  The only questional is sasl, I don't know if it's in the
      right lib path, and don't know if it's seven used, but I *did*
      install it from /usr/ports, so it should be in the right dirs.
     -With all this in mind, and setup, I then tried the compile, and get
      this out put;

loading cache ./config.cache
checking host system type... (cached) i386-unknown-freebsdelf4.3
checking target system type... (cached) i386-unknown-freebsdelf4.3
checking build system type... (cached) i386-unknown-freebsdelf4.3
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking for mawk... (cached) awk
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gnutar... (cached) tar

checking for gcc... (cached) gcc
checking whether the C compiler (gcc -I/usr/local/include
-I/usr/local/include/bind -DPIC -I/us
r/local/include -I/usr/local/include/bind -DPIC -L/usr/lib) works... yes
checking whether the C compiler (gcc -I/usr/local/include
-I/usr/local/include/bind -DPIC -I/us
r/local/include -I/usr/local/include/bind -DPIC -L/usr/lib) is a
cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking for a BSD compatible install... /usr/bin/install -c
checking for lber.h... (cached) yes
checking for ldap.h... (cached) yes
checking for ldap_ssl.h... (cached) no
checking for nss.h... (cached) no
checking for nsswitch.h... (cached) no
checking for irs.h... (cached) no
checking for thread.h... (cached) no
checking for pthread.h... (cached) yes
checking for malloc.h... (cached) no
checking for shadow.h... (cached) no
checking for port_before.h... (cached) no
checking for port_after.h... (cached) no
checking for aliases.h... (cached) no
checking for netinet/if_ether.h... (cached) yes
checking for netinet/ether.h... (cached) no
checking for ctype.h... (cached) yes
checking for db.h... (cached) yes
checking for db1/db.h... (cached) no
checking for db_185.h... (cached) no
checking for db3/db_185.h... (cached) yes
checking for alignof.h... (cached) no
checking for rpc/rpcent.h... (cached) no
checking for sys/byteorder.h... (cached) no
checking for libc-lock.h... (cached) no
checking for bits/libc-lock.h... (cached) no
checking for main in -lresolv... (cached) no
checking for main in -lnsl... (cached) no
checking for strtok_r... (cached) yes
checking for sigset... (cached) no
checking for res_search... (cached) yes
checking for dn_expand... (cached) yes
checking for snprintf... (cached) yes
checking for gethostbyname... (cached) yes
checking for nsdispatch... (cached) no
checking for pthread_atfork... (cached) no
checking for dlopen in -ldl... (cached) no
checking for main in -ldb... (cached) yes
checking for main in -llber... (cached) yes
checking for main in -lldap... (cached) yes
checking for ldap_init... (cached) yes
checking for ldap_get_lderrno... (cached) no
checking for ldap_parse_result... (cached) yes
checking for ldap_memfree... (cached) yes
checking for ldap_controls_free... (cached) yes
checking for ldap_ld_free... (cached) yes
checking for ldap_explode_rdn... (cached) yes
checking for ldap_set_option... (cached) yes
checking for ldap_get_option... (cached) yes
checking for ldapssl_client_init... (cached) no
checking for ldap_start_tls_s... (cached) yes
checking for ldap_pvt_tls_set_option... (cached) yes
checking for ldap_initialize... (cached) yes
checking for ldap_set_rebind_proc... (cached) yes
checking whether ldap_set_rebind_proc takes 3 arguments... (cached) 2
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
config.h is unchanged
gcc -DHAVE_CONFIG_H -I. -I. -I.   -I/usr/local/include
-I/usr/local/include/bind -DPIC -DLDAP_R
EFERRALS -DPIC -D_REENTRANT  -I/usr/local/include
-I/usr/local/include/bind -DPIC -Wall -fPIC -
c ldap-nss.c
In file included from ldap-nss.c:77:
ldap-nss.h:441: syntax error before `*'
ldap-nss.h:442: warning: type defaults to `int' in declaration of
`NSS_STATUS'
ldap-nss.h:442: `NSS_STATUS' declared as function returning a function
ldap-nss.h:502: `_nss_ldap_search_s' declared as function returning a
function
ldap-nss.h:511: `_nss_ldap_search' declared as function returning a
function
ldap-nss.h:516: `_nss_ldap_result' declared as function returning a
function
ldap-nss.h:523: `_nss_ldap_read' declared as function returning a function
ldap-nss.h:535: syntax error before `parser_t'
ldap-nss.h:535: `_nss_ldap_getent' declared as function returning a
function
ldap-nss.h:547: syntax error before `parser_t'
ldap-nss.h:547: `_nss_ldap_getbyname' declared as function returning a
function
ldap-nss.h:557: `_nss_ldap_assign_attrvals' declared as function returning
a function
ldap-nss.h:564: `_nss_ldap_assign_attrval' declared as function returning
a function
ldap-nss.h:572: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.h:574: `_nss_ldap_oc_check' declared as function returning a
function
In file included from ldap-nss.c:80:
util.h:41: `_nss_ldap_getrdnvalue' declared as function returning a
function
util.h:49: `_nss_ldap_dn2uid' declared as function returning a function
util.h:113: `_nss_ldap_readconfig' declared as function returning a
function
util.h:120: `_nss_ldap_escape_string' declared as function returning a
function
In file included from ldap-nss.c:81:
dnsconfig.h:29: `_nss_ldap_getdnsdn' declared as function returning a
function
dnsconfig.h:32: `_nss_ldap_readconfigfromdns' declared as function
returning a function
ldap-nss.c:178: `do_open' declared as function returning a function
ldap-nss.c:197: `do_result' declared as function returning a function
ldap-nss.c:205: `do_filter' declared as function returning a function
ldap-nss.c:212: syntax error before `parser_t'
ldap-nss.c:212: `do_parse' declared as function returning a function
ldap-nss.c:219: syntax error before `parser_t'
ldap-nss.c:219: `do_parse_s' declared as function returning a function
ldap-nss.c:235: `do_with_reconnect' declared as function returning a
function
ldap-nss.c:523: `do_open' declared as function returning a function
ldap-nss.c: In function `do_open':
ldap-nss.c:727: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:727: (Each undeclared identifier is reported only once
ldap-nss.c:727: for each function it appears in.)
ldap-nss.c:759: invalid lvalue in assignment
ldap-nss.c:766: invalid lvalue in assignment
ldap-nss.c:773: warning: return makes integer from pointer without a cast
ldap-nss.c:837: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1019: warning: control reaches end of non-void function
ldap-nss.c: In function `_nss_ldap_ent_context_init':
ldap-nss.c:1196: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c: In function `_nss_ldap_ent_context_release':
ldap-nss.c:1237: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c: At top level:
ldap-nss.c:1257: `do_filter' declared as function returning a function
ldap-nss.c: In function `do_filter':
ldap-nss.c:1286: invalid lvalue in assignment
ldap-nss.c:1286: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1287: warning: return makes integer from pointer without a cast
ldap-nss.c:1298: invalid lvalue in assignment
ldap-nss.c:1301: invalid lvalue in assignment
ldap-nss.c:1302: warning: return makes integer from pointer without a cast
ldap-nss.c:1309: invalid lvalue in assignment
ldap-nss.c:1310: warning: return makes integer from pointer without a cast
ldap-nss.c:1355: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:1363: `do_result' declared as function returning a function
ldap-nss.c: In function `do_result':
ldap-nss.c: In function `do_result':
ldap-nss.c:1365: function `stat' is initialized like a variable
ldap-nss.c:1365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1401: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1404: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1430: `NSS_NOTFOUND' undeclared (first use in this function
ldap-nss.c:1455: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1466: `do_with_reconnect' declared as function returning a
function
ldap-nss.c: In function `do_with_reconnect':
ldap-nss.c:1468: function `stat' is initialized like a variable
ldap-nss.c:1468: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1493: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1520: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1535: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:1540: switch quantity not an integer
ldap-nss.c:1543: warning: unreachable code at beginning of switch
statement
ldap-nss.c:1565: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1661: syntax error before `parser_t'
ldap-nss.c:1662: `do_parse' declared as function returning a function
ldap-nss.c: In function `do_parse':
ldap-nss.c:1663: function `parseStat' is initialized like a variable
ldap-nss.c:1663: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1676: function `resultStat' is initialized like a variable
ldap-nss.c:1676: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1678: `ctx' undeclared (first use in this function)
ldap-nss.c:1682: invalid lvalue in assignment
ldap-nss.c:1688: invalid lvalue in assignment
ldap-nss.c:1702: warning: implicit declaration of function `parser'
ldap-nss.c:1702: `result' undeclared (first use in this function)
ldap-nss.c:1703: `buffer' undeclared (first use in this function)
ldap-nss.c:1703: `buflen' undeclared (first use in this function)
ldap-nss.c:1703: invalid lvalue in assignment
ldap-nss.c:1706: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1720: `errnop' undeclared (first use in this function)
ldap-nss.c:1733: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1741: syntax error before `parser_t'
ldap-nss.c:1742: `do_parse_s' declared as function returning a function
ldap-nss.c: In function `do_parse_s':
ldap-nss.c:1743: function `parseStat' is initialized like a variable
ldap-nss.c:1743: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:1757: `ctx' undeclared (first use in this function)
ldap-nss.c:1784: `result' undeclared (first use in this function)
ldap-nss.c:1784: `buffer' undeclared (first use in this function)
ldap-nss.c:1784: `buflen' undeclared (first use in this function)
ldap-nss.c:1784: invalid lvalue in assignment
ldap-nss.c:1787: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:1791: `errnop' undeclared (first use in this function)
ldap-nss.c:1804: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:1814: `_nss_ldap_read' declared as function returning a
function
ldap-nss.c:1881: `_nss_ldap_result' declared as function returning a
function
ldap-nss.c:1894: `_nss_ldap_search_s' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_search_s':
ldap-nss.c:1904: invalid lvalue in assignment
ldap-nss.c:1905: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1909: warning: return makes integer from pointer without a cast
ldap-nss.c:1944: invalid lvalue in assignment
ldap-nss.c:1946: warning: return makes integer from pointer without a cast
ldap-nss.c:1950: invalid lvalue in assignment
ldap-nss.c:1954: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c: At top level:
ldap-nss.c:1965: `_nss_ldap_search' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_search':
ldap-nss.c:1975: invalid lvalue in assignment
ldap-nss.c:1976: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:1980: warning: return makes integer from pointer without a cast
ldap-nss.c:2016: invalid lvalue in assignment
ldap-nss.c:2018: warning: return makes integer from pointer without a cast
ldap-nss.c:2022: invalid lvalue in assignment
ldap-nss.c:2026: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2043: syntax error before `parser_t'
ldap-nss.c:2044: `_nss_ldap_getent' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_getent':
ldap-nss.c:2045: function `stat' is initialized like a variable
ldap-nss.c:2045: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2049: `ctx' undeclared (first use in this function)
ldap-nss.c:2058: `NSS_UNAVAIL' undeclared (first use in this function)
ldap-nss.c:2077: `filterprot' undeclared (first use in this function)
ldap-nss.c:2077: `sel' undeclared (first use in this function)
ldap-nss.c:2077: invalid lvalue in assignment
ldap-nss.c:2082: warning: return makes integer from pointer without a cast
ldap-nss.c:2091: `result' undeclared (first use in this function)
ldap-nss.c:2091: `buffer' undeclared (first use in this function)
ldap-nss.c:2091: `buflen' undeclared (first use in this function)
ldap-nss.c:2091: `errnop' undeclared (first use in this function)
ldap-nss.c:2091: `parser' undeclared (first use in this function)
ldap-nss.c:2091: invalid lvalue in assignment
ldap-nss.c:2095: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2109: syntax error before `parser_t'
ldap-nss.c:2110: `_nss_ldap_getbyname' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_getbyname':
ldap-nss.c:2111: function `stat' is initialized like a variable
ldap-nss.c:2111: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2120: `args' undeclared (first use in this function)
ldap-nss.c:2120: `filterprot' undeclared (first use in this function)
ldap-nss.c:2120: `sel' undeclared (first use in this function)
ldap-nss.c:2120: invalid lvalue in assignment
ldap-nss.c:2121: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2125: warning: return makes integer from pointer without a cast
ldap-nss.c:2138: `result' undeclared (first use in this function)
ldap-nss.c:2138: `buffer' undeclared (first use in this function)
ldap-nss.c:2138: `buflen' undeclared (first use in this function)
ldap-nss.c:2138: `errnop' undeclared (first use in this function)
ldap-nss.c:2138: `parser' undeclared (first use in this function)
ldap-nss.c:2138: invalid lvalue in assignment
ldap-nss.c:2147: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2166: `_nss_ldap_assign_attrvals' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_attrvals':
ldap-nss.c:2186: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2200: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2247: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2255: `_nss_ldap_assign_attrval' declared as function returning
a function
ldap-nss.c: In function `_nss_ldap_assign_attrval':
ldap-nss.c:2121: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2125: warning: return makes integer from pointer without a cast
ldap-nss.c:2138: `result' undeclared (first use in this function)
ldap-nss.c:2138: `buffer' undeclared (first use in this function)
ldap-nss.c:2138: `buflen' undeclared (first use in this function)
ldap-nss.c:2138: `errnop' undeclared (first use in this function)
ldap-nss.c:2138: `parser' undeclared (first use in this function)
ldap-nss.c:2138: invalid lvalue in assignment
ldap-nss.c:2147: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:2166: `_nss_ldap_assign_attrvals' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_attrvals':
ldap-nss.c:2186: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2200: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2247: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2255: `_nss_ldap_assign_attrval' declared as function returning
a function
ldap-nss.c: In function `_nss_ldap_assign_attrval':
ldap-nss.c:2262: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2269: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2282: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2283: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2294: `_nss_ldap_assign_userpassword' declared as function
returning a function
ldap-nss.c: In function `_nss_ldap_assign_userpassword':
ldap-nss.c:2365: `NSS_TRYAGAIN' undeclared (first use in this function)
ldap-nss.c:2382: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2383: warning: control reaches end of non-void function
ldap-nss.c: At top level:
ldap-nss.c:2387: `_nss_ldap_oc_check' declared as function returning a
function
ldap-nss.c: In function `_nss_ldap_oc_check':
ldap-nss.c:2389: function `ret' is initialized like a variable
ldap-nss.c:2389: `NSS_NOTFOUND' undeclared (first use in this function)
ldap-nss.c:2398: `NSS_SUCCESS' undeclared (first use in this function)
ldap-nss.c:2409: warning: return makes integer from pointer without a cast
ldap-nss.c: At top level:
ldap-nss.c:21: warning: `rcsId' defined but not used
gmake: *** [ldap-nss.o] Error 1

Notice I used gmake there, I tried this with both make, and gmake, and
still no luck.  So my next venture to try and get this working is a bit
more involving.  I plan to try this again on a FreeBSD 5.0 box, and see if
it work, and if it does, strip out what I
can, and insert that into
FreeBSD 4.3.

What still upsets me is people asking about similar problems they run
into, and ask a question like "should I compile this in stead of that..."
or "should I be doing something diffrent...", etc, and then somebody
replies with an answer "I got nss_ldap to compile in FreeBSD, and it works
great!!!"... and that's all they say.  I do not know why they hoard this
information, but I am beginning to belive that they are lying.  Because
the more and more I dig into this project, it appears it dosn't seem to
work well at all.

-Rory Savage

 
 
 

1. FreeBSD 4.3 LDAP Authentication BIND IRS

It appears that my last obsticle in getting nss_ldap working is FreeBSD's
BIND IRS & libc functionality.

Successful steps in getting FreeBSD LDAP Authentication,

        1. compiled OpenLDAP from source
        2. compiled pam_ldap from source
        3. made BIND 8 from FreeBSD's ports collection & source

        - and that's about it -

Attemping to build a working nss_ldap is still a problem.  When I try to
build nss_ldap as of now, I get these kind of errors,
gcc -DHAVE_CONFIG_H -I. -I. -I.   -DLDAP_REFERRALS -DPIC -D_REENTRANT  -g
-O2 -Wall -fPIC -c ldap-pwd.c
In file included from /usr/include/irs.h:31,
                 from irs-nss.h:32,
                 from ldap-nss.h:57,
                 from ldap-pwd.c:49:
/usr/include/resolv.h:104: field `nsaddr_list' has incomplete type
/usr/include/resolv.h:114: field `addr' has incomplete type
/usr/include/resolv.h:129: field `ina' has incomplete type
/usr/include/resolv.h:130: field `in6a' has incomplete type
In file included from irs-nss.h:32,
                 from ldap-nss.h:57,
                 from ldap-pwd.c:49:
/usr/include/irs.h:48: syntax error before `res_state'
/usr/include/irs.h:49: syntax error before `)'
/usr/include/irs.h:64: syntax error before `res_state'
/usr/include/irs.h:65: syntax error before `)'
/usr/include/irs.h:64: syntax error before `res_state'
/usr/include/irs.h:65: syntax error before `)'
/usr/include/irs.h:81: syntax error before `res_state'
/usr/include/irs.h:82: syntax error before `)'
/usr/include/irs.h:97: syntax error before `res_state'
/usr/include/irs.h:98: syntax error before `)'
/usr/include/irs.h:115: syntax error before `res_state'
/usr/include/irs.h:116: syntax error before `)'
/usr/include/irs.h:131: syntax error before `res_state'
/usr/include/irs.h:132: syntax error before `)'
/usr/include/irs.h:173: syntax error before `res_state'
/usr/include/irs.h:174: syntax error before `)'
ldap-pwd.c:21: warning: `rcsId' defined but not used
*** Error code 1

Stop in /usr/ldap/src/nss_ldap-172.

Now I was told that I may have to recompile libc, and get irs working.
How does one do this?  I mean, what portion of the libc source do I
modify, and include irs functionality?

--
Rory Savage

2. Red Hat 3.0.3: adding packages afterwards?

3. LDAP over SSL using OpenLDAP/OpenSSL/Cyrus SASL with Netscape's LDAP server

4. Having problems with a Chips and Tech 65554

5. Xamian on FreeBSD 4.3 || X 4.1.0 on FreeBSD 4.3

6. Trouble Installing via FTP

7. ldap authentication against IPlanet LDAP server

8. IDE poweroff -> hangup

9. Proxy authentication on FreeBSD 4.3

10. aix ldap server 4.3 problems

11. SUN LDAP, Netscape LDAP (SUN), OPENLDAP, which one?????

12. OpenLDAP or SUN ONE DS5.2 HOW-TO updated with sudo+LDAP and apache+LDAP info

13. slapd & openldap // can't connect to ldap server