[Samba] A mass O trouble with solaris 10 and Samba+ADS
Robert Bannocks
R.Bannocks at nhm.ac.uk
Fri Dec 8 16:51:30 GMT 2006
I have been having a great deal of trouble compiling Samba on Solaris 10
with ADS support.
Kerberos compiles fine.
Samba does not configure with the standard Solaris LDAP libraries and
fails in the following way.:
checking for ldap_initialize... no
configure: error: Active Directory support requires ldap_initialize
And is caused by:
configure:35160: checking for ldap_initialize
configure:35217: gcc -o conftest -O -D_SAMBA_BUILD_ -D_LARGEFILE_SOURCE
-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DLDAP_DE
PRECATED -lthread conftest.c -lldap -lresolv -lnsl -lsocket >&5
Undefined first referenced
symbol in file
ldap_initialize /var/tmp//ccGc936o.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure:35223: $? = 1
As documented elsewhere you can use the OpenLDAP libraries:
Compiling these requires setting CFLAGS=-D_AVL_H inorder to compile
them.
I configured OpenLDAP as follows:
./configure -prefix=/usr/local/opt/openldap-2.3.27 -with-shared=no
make install
Then running samba configuration with these setting:
LDFAGS=-L/usr/local/opt/openldap-2.3.27/lib
CPPFLAGS=-I/usr/local/opt/openldap-2.3.27/include
./configure --prefix=/usr/local/opt/samba/samba-3.0.23d --with-automount
--with-nisplus-home --with-acl-support --with-ads
--=/usr/local/opt/krb5/krb5-1.5.1
Gives the following error:
checking for ldap_dn2ad_canonical... no
configure: error: libldap is needed for LDAP support
The problem being seen in config.log
Undefined first referenced
symbol in file
ldap_dn2ad_canonical /var/tmp//ccI8vbBq.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure:35045: $? = 1
configure: failed program was:
However configure works if OpenLDAP is compiled with shared libraries!
i.e OpenLDAP configured with ./configure
-prefix=/usr/local/opt/openldap-2.3.27 -with-shared=yes
I have yet to find out why this works with shared libraries but not with
static ones (which is what I want).
The failure to configure with static libraries seems to be because
Openldap's configure picks up the presence of libsasl on Solaris 10 (not
present on solaris 9) and uses code found in it. The compile line
invoked by Samba's configure does not include -lsasl and hence it fails
to compile the program and give the above misleading error.
Setting
LDFLAGS="-L/usr/local/opt/openldap-2.3.27/lib -lsasl"
Makes configure work and samba compiles clean with only the static
libraries.
Also re-compiling OpenLDAP with
./configure -prefix=/usr/local/opt/openldap-2.3.27 -with-shared=no
-with-cyrus-sasl=no
Also produces a set of (static) openldap libraries that Samba configure
copes with without adding -lsasl to the LDFLAGS.
So my questions.
1. Are these known bugs? - i.e. if openldap was compiled with sasl
support then the compilation line requires a -lsasl. Is configure going
to be fixed?
2. For samba purposes is removing libldap's dependency on sasl going to
break or limit the functionality of samba in any way? In my case I am
not intending to use the OpenLDAP libraries for anything other than
Samba.
3. Will samba ever be "fixed" to compile/configure with native Solaris
LDAP libraries.
4. It would be nice to see this documented somewhere, my googleing found
little on this topic.
Thanks in advance.
RB
More information about the samba
mailing list