Qmail-LDAP
[Top] [All Lists]

problem qmail-ldap control patch with gcc 4.1

To: qmail-ldap@qmail-ldap.org
Subject: problem qmail-ldap control patch with gcc 4.1
From: Carsten Böcker <news@cb-world.de>
Date: Wed, 22 Nov 2006 14:12:45 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: qmail-ldap-list@securepoint.com
Delivered-to: mailing list qmail-ldap@qmail-ldap.org
Mailing-list: contact qmail-ldap-help@qmail-ldap.org; run by ezmlm
User-agent: Thunderbird 1.5.0.8 (X11/20061110)
Hallo,

tried to build qmail-ldap with controlpatch. Got some problems
that I also found by google from others.
Played a while and now think that this is a problem with version
4.1 of gcc.

I put a log of everything I tried in this Mail.
Perhaps someone will have a resolution for the problem with gcc 4.1
or a resolution for the problem with verify_ldap_file_check in
my case.
I am not very experienced in C-programming so perhaps I miss something.

But I tried my best to review all Installation-Documents I found out
there and also review my configuration and found nothing bad.

If not this perhaps helps someone who have the same problems.

greetings
Carsten Böcker

PS:
I made the diff with wrong oder in the files but you can see the changes.

Log follows:

first tried to build with only qmail-ldap patch:

patch -p 1 < ../qmail-ldap-1.03-20060201.patch

--- Makefile    2006-11-18 10:51:27.000000000 +0100
+++ Makefile.orig       2006-11-18 10:49:53.000000000 +0100
@@ -20,12 +20,11 @@
# -DQUOTATRASH to include the Trash in the quota calculation (normaly it
is not)
# -DSMTPEXECCHECK to enable smtp DOS/Windows executable detection
#LDAPFLAGS=-DQLDAP_CLUSTER -DEXTERNAL_TODO -DDASH_EXT -DDATA_COMPRESS
-DQMQP_COMPRESS -DSMTPEXECCHECK
-LDAPFLAGS=-DDASH_EXT -DDATA_COMPRESS -DALTQUEUE -DBIGTODO

# Perhaps you have different ldap libraries, change them here
-LDAPLIBS=-L/usr/lib -lldap -llber
+LDAPLIBS=-L/usr/local/lib -lldap -llber
# and change the location of the include files here
 -LDAPINCLUDES=-I/usr/include
 +LDAPINCLUDES=-I/usr/local/include
# on Slowaris you need -lresolv and probably a LD_RUN_PATH added like this:
#LDAPLIBS=-L/opt/OpenLDAP/lib -lldap -llber -lresolv -R/opt/OpenLDAP/lib
# for example on my Linux box I use:
@@ -36,35 +35,35 @@ LDAPINCLUDES=-I/usr/include
# ZLIB needed for -DDATA_COMPRESS and -DQMQP_COMPRESS
#ZLIB=-lz
# or you installed zlib in a different path you can use something like this
-ZLIB=-L/usr/lib -lz
-ZINCLUDES=-I/usr/include
+#ZLIB=-L/opt/zlib/lib -lz
+#ZINCLUDES=-I/opt/zlib/include

# TLS (SMTP encryption) in qmail-smtpd and qmail-remote, see TLS.readme
# You need OpenSSL for this
# use -DTLS_REMOTE to enable tls support in qmail-remote
# use -DTLS_SMTPD to enable tls support in qmail-smtpd
# use -DTLSDEBUG to enable additional tls debug information in qmail-remote
-TLS=-DTLS_REMOTE -DTLS_SMTPD
+#TLS=-DTLS_REMOTE -DTLS_SMTPD
# Path to OpenSSL includes
-TLSINCLUDES=-I/usr/include
+#TLSINCLUDES=-I/usr/local/include
# Path to OpenSSL libraries
-TLSLIBS=-L/usr/lib -lssl -lcrypto
+#TLSLIBS=-L/usr/local/lib -lssl -lcrypto
# Path to OpenSSL binary
#OPENSSLBIN=/usr/local/bin/openssl
-OPENSSLBIN=openssl
+#OPENSSLBIN=openssl

# to make the Netscape download progress bar work with qmail-pop3d
# uncomment the next line (allready done)
MNW=-DMAKE_NETSCAPE_WORK

# to enable the auto-maildir-make feature uncomment the next line
-MDIRMAKE=-DAUTOMAILDIRMAKE
+#MDIRMAKE=-DAUTOMAILDIRMAKE

# to enable the auto-homedir-make feature uncomment the next line
-HDIRMAKE=-DAUTOHOMEDIRMAKE
+#HDIRMAKE=-DAUTOHOMEDIRMAKE

# on most systems we need this to make auth_pop and auth_imap
-SHADOWLIBS=-lcrypt
+#SHADOWLIBS=-lcrypt
# OpenBSD and other Systems do not have libcrypt, so comment the line out
# if you get linking problems.
# To use shadow passwords under some Linux OS, uncomment the next two lines.

make setup check
and tested the installation -> no problem found

tried it with qmail-ldap-control patch:

patch -p1 < ../qmail-ldap-1.03-20060201.patch
patch -p2 < ../qmail-ldap-1.03-20060201-controls20060403b

--- Makefile    2006-11-18 11:03:01.000000000 +0100
+++ Makefile.orig       2006-11-18 10:58:38.000000000 +0100
@@ -21,33 +21,32 @@
# -DSMTPEXECCHECK to enable smtp DOS/Windows executable detection
# -DCOURIER use Courier POP3d/IMAPd instead of Qmail POP3d
#LDAPFLAGS=-DQLDAP_CLUSTER -DEXTERNAL_TODO -DDASH_EXT -DDATA_COMPRESS
-DQMQP_COMPRESS -DSMTPEXECCHECK -DCOURIER
-LDAPFLAGS=-DDASH_EXT -DDATA_COMPRESS -DALTQUEUE -DBIGTODO

# * These are some options to securly connect to the LDAP server
#   -DSECUREBIND_SASL  Bind using SASL
#   -DSECUREBIND_SSL   Encrypt the channel with SSL
#   -DSECUREBIND_TLS   Encrypt the channel with TLS (SSL v3)
#   -DSECUREBIND_ALL   All of the above...
-SECUREBIND=-DSECUREBIND_ALL
+#SECUREBIND=-DSECUREBIND_ALL

# * Log authentication success/failures in auth_{pop,imap,smtp}
-SYSLOGAUTH=-DSYSLOGAUTH
+#SYSLOGAUTH=-DSYSLOGAUTH

# -DUSE_RFC2307                -> Follow the RFC2307
# -DUSE_RFC822         -> Follow the RFC822
# See the QLDAPINSTALL file for more about this.
-RFCFLAGS=-DUSE_RFC2307
+#RFCFLAGS=-DUSE_RFC2307 -DUSE_RFC822

# to enable having the configuration (~control/* in the LDAP database
# to, uncomment the following line and read QLDAPINSTALL.
# -DUSE_CONTROLDB      Search LDAP for control files
# -DQLDAP_BAILOUT      First search LDAP, then FS
-CONTROLDB=-DUSE_CONTROLDB -DQLDAP_BAILOUT
+#CONTROLDB=-DUSE_CONTROLDB -DQLDAP_BAILOUT

# Perhaps you have different ldap libraries, change them here
-LDAPLIBS=-L/usr/lib -lldap -llber
+#LDAPLIBS=-L/usr/local/lib -lldap -llber
# and change the location of the include files here
-LDAPINCLUDES=-I/usr/include
+#LDAPINCLUDES=-I/usr/local/include
# on Slowaris you need -lresolv and probably a LD_RUN_PATH added like this:
#LDAPLIBS=-L/opt/OpenLDAP/lib -lldap -llber -lresolv -R/opt/OpenLDAP/lib
# for example on my Linux box I use:
@@ -58,35 +57,35 @@ LDAPINCLUDES=-I/usr/include
# ZLIB needed for -DDATA_COMPRESS and -DQMQP_COMPRESS
#ZLIB=-lz
# or you installed zlib in a different path you can use something like this
-ZLIB=-L/usr/lib -lz
-ZINCLUDES=-I/usr/include
+#ZLIB=-L/opt/zlib/lib -lz
+#ZINCLUDES=-I/opt/zlib/include

# TLS (SMTP encryption) in qmail-smtpd and qmail-remote, see TLS.readme
# You need OpenSSL for this
# use -DTLS_REMOTE to enable tls support in qmail-remote
# use -DTLS_SMTPD to enable tls support in qmail-smtpd
# use -DTLSDEBUG to enable additional tls debug information in qmail-remote
-TLS=-DTLS_REMOTE -DTLS_SMTPD
+#TLS=-DTLS_REMOTE -DTLS_SMTPD
# Path to OpenSSL includes
-TLSINCLUDES=-I/usr/include
+#TLSINCLUDES=-I/usr/local/include
# Path to OpenSSL libraries
-TLSLIBS=-L/usr/lib -lssl -lcrypto
+#TLSLIBS=-L/usr/local/lib -lssl -lcrypto
# Path to OpenSSL binary
#OPENSSLBIN=/usr/local/bin/openssl
-OPENSSLBIN=openssl
+#OPENSSLBIN=openssl

# to make the Netscape download progress bar work with qmail-pop3d
# uncomment the next line (allready done)
-MNW=-DMAKE_NETSCAPE_WORK
+#MNW=-DMAKE_NETSCAPE_WORK

# to enable the auto-maildir-make feature uncomment the next line
-MDIRMAKE=-DAUTOMAILDIRMAKE
+#MDIRMAKE=-DAUTOMAILDIRMAKE

# to enable the auto-homedir-make feature uncomment the next line
-HDIRMAKE=-DAUTOHOMEDIRMAKE
+#HDIRMAKE=-DAUTOHOMEDIRMAKE

# on most systems we need this to make auth_pop and auth_imap
-SHADOWLIBS=-lcrypt
+#SHADOWLIBS=-lcrypt
# OpenBSD and other Systems do not have libcrypt, so comment the line out
# if you get linking problems.
# To use shadow passwords under some Linux OS, uncomment the next two lines.

make fails with:

control.c:62: Fehler: Statische Deklaration von »sasl_flags« folgt
nicht-statischer Deklaration
control.h:19: Fehler: Vorherige Deklaration von »sasl_flags« war hier
control.c: In Funktion »control_ldap_search«:
control.c:408: Warnung: Unverträgliche implizite Deklaration der
eingebauten Funktion »strndup«
control.c:463: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
Typkonvertierung
make: *** [control.o] Fehler 1

google only find this:

http://www.mail-archive.com/qmail-ldap@qmail-ldap.org/msg05692.html

change qldap.c
unsigned        sasl_flags      = LDAP_SASL_AUTOMATIC;
to
static unsigned sasl_flags      = LDAP_SASL_AUTOMATIC;

change control.h
extern unsigned sasl_flags;
to
static unsigned sasl_flags;

make fails with:

control.o: In function `control_ldap_search':
control.c:(.text+0xa8f): undefined reference to `str_diffn'
control.c:(.text+0xf7d): undefined reference to `str_diffn'
collect2: ld gab 1 als Ende-Status zurück
make: *** [qmail-newmrh] Fehler 1

google find:
http://www.mail-archive.com/qmail-ldap@qmail-ldap.org/msg05460.html

don't want debug on production so changed Makefile:

qmail-newmrh: \
load qmail-newmrh.o getln.a open.a cdbmake.a seek.a case.a \
stralloc.a alloc.a strerr.a substdio.a error.a str.a auto_qmail.o \
$(NEWLDAPPROGLIBS) $(SECUREBINDLIBS) $(QLDAPLIB) $(CONTROLLIBS)
      ./load qmail-newmrh getln.a open.a cdbmake.a seek.a \
      case.a stralloc.a alloc.a strerr.a substdio.a error.a \
      $(QLDAPLIB) $(CONTROLLIBS) str.a auto_qmail.o \
      $(NEWLDAPPROGLIBS) $(SECUREBINDLIBS) $(LDAPLIBS)
to
load qmail-newmrh.o getln.a open.a cdbmake.a seek.a case.a \
stralloc.a alloc.a strerr.a substdio.a error.a str.a auto_qmail.o \
$(NEWLDAPPROGLIBS) $(SECUREBINDLIBS) $(QLDAPLIB) $(CONTROLLIBS)
      ./load qmail-newmrh getln.a open.a cdbmake.a seek.a \
      case.a stralloc.a alloc.a strerr.a substdio.a error.a str_diffn.o \
      $(QLDAPLIB) $(CONTROLLIBS) str.a auto_qmail.o \
      $(NEWLDAPPROGLIBS) $(SECUREBINDLIBS) $(LDAPLIBS)

compiles fine, started ok

did not read any control-setting from ldap (tested with locals)

ldif for server:

dn: cn=cb1.cb.home,ou=server,o=cb-world,c=de
badMailFrom: SprecialOffer@inyouremail.com
badMailFrom: @pediatrician.com
badMailFrom: morpheus@inyouremail.com
badMailFrom: woelbling@gmx.de
badMailFrom: big@boss.com
badMailFrom: andre.schneider@s-convia.de
badMailFrom: @pages.wotch.com
cn: cb1.cb.home
concurrencyRemote: 80
defaultDomain: cb-world.de
dirMaker: /var/qmail/bin/dirmaker
doubleBounceTo: bounce_admin
ldapBaseDN: c=de
ldapGid: 2110
ldapLocalDelivery: 0
ldapMessageStore: /data/maildirs
ldapServer: localhost
ldapUid: 11184
locals: cb-world.de
locals: cb.home
locals: cb1.cb.home
objectClass: top
objectClass: qmailControl
queueLifetime: 259200
rcptHosts: cb-world.de
rcptHosts: cb.home
rcptHosts: cb1.cb.home
tarpitCount: 20
tarpitDelay: 5

controls/ldap*:

ldapbasedn
::::::::::::::
o=cb-world,c=de

ldapcontroldn
::::::::::::::
ou=server,o=cb-world,c=de

ldapgid
::::::::::::::
2110

ldaplocaldelivery
::::::::::::::
0

ldaplogin
::::::::::::::
cn=qmail,ou=systemuser,o=cb-world,c=de

ldapmessagestore
::::::::::::::
/data/maildirs

ldapobjectclass
::::::::::::::
qmailuser

ldappassword
::::::::::::::
(secret)

ldapserver
::::::::::::::
localhost

ldapuid
::::::::::::::
11184

compile again with DEBUG=-DDEBUG set and start with LOGLEVEL=128

Logfile gives:

@40000000455edfcf35353d1c control_readline: Looking for: 'control/me'
@40000000455edfcf353544ec                   Searching FS
@40000000455edfcf353548d4                     2b:value (control/me) =
'cb1.cb.home'
@40000000455edfcf353550a4 control_readline: Looking for:
'control/ldappassword'
@40000000455edfcf3535548c                   Searching FS
@40000000455edfcf35355874                     2a:value
(control/ldappassword) = '<secret>'
@40000000455edfcf35356044 control_readline: Looking for: 'control/ldaplogin'
@40000000455edfcf3535aa7c                   Searching FS
@40000000455edfcf3535b24c                     2b:value
(control/ldaplogin) = 'cn=qmail,ou=systemuser,o=cb-world,c=de'
@40000000455edfcf3535b634 control_readfile: Looking for:
'control/ldapserver'
@40000000455edfcf3535ba1c                   Searching FS
@40000000455edfcf3535c1ec control_readline: Looking for: 'control/port_ldap'
@40000000455edfcf3535c5d4                   Searching FS
@40000000455edfcf3535d95c                     Can't open
control/port_ldap (errno=2)
@40000000455edfcf3535dd44 control_readline: Looking for:
'control/ldapcontroldn'
@40000000455edfcf3535e12c                   Searching FS
@40000000455edfcf3535e514                     2b:value
(control/ldapcontroldn) = 'ou=server,o=cb-world,c=de'
@40000000455edfcf3535ece4 control_readline: Looking for:
'control/ldapsecurebind'
@40000000455edfcf3535f0cc                   Searching FS
@40000000455edfcf35360454                     Can't open
control/ldapsecurebind (errno=2)
@40000000455edfcf3536277c qldap_getcontrols_securebind: retreiving
secure bind options: use_uri=0, use_ssl=0
@40000000455edfcf35362f4c                               string2argv:
out[0] = nosecure
@40000000455edfcf35363334                               string2argv:
arguments = 1
@40000000455edfcf3536371c                               done.
@40000000455edfcf35363eec qldap_ctrl_bind: Allocating memory for LDAP
connection: SUCCESS
@40000000455edfcf35365274 qldap_ctrl_bind: Opening LDAP connection to
localhost:
@40000000455edfcf3536565c   qldap_open: use_uri=0, use_ssl=0, use_tls=0
@40000000455edfcf35365a44   qldap_open: ldap_init(localhost, 389) -> SUCCESS
@40000000455edfcf35366214   qldap_set_option: set referrals successful
@40000000455edfcf353665fc   -> LDAP connection opened successfully
@40000000455edfcf353669e4 qldap_ctrl_bind: Binding to LDAP server as
cn=qmail,ou=systemuser,o=cb-world,c=de:
@40000000455edfcf3537776c   qldap_bind: successful
@40000000455edfcf35749bc4
@40000000455edfcf3574a394 control_readline: Looking for:
'control/ldapbasedn'
@40000000455edfcf35753bec                   Searching FS
@40000000455edfcf3575b504                     2b:value
(control/ldapbasedn) = 'o=cb-world,c=de'
@40000000455edfcf357687f4 control_readline: Looking for:
'control/ldapobjectclass'
@40000000455edfcf357704f4                   Searching FS
@40000000455edfcf35777a24                     2b:value
(control/ldapobjectclass) = 'qmailuser'
@40000000455edfcf35781e34 control_readline: Looking for:
'control/ldaptimeout'
@40000000455edfcf3578c62c                   Searching FS
@40000000455edfcf35793b5c                     Can't open
control/ldaptimeout (errno=2)
@40000000455edfcf3579c7fc control_readline: Looking for:
'control/ldaprebind'
@40000000455edfcf357a4114                   Searching FS
@40000000455edfcf357ab644                     Can't open
control/ldaprebind (errno=2)
@40000000455edfcf357b3efc control_readline: Looking for: 'control/ldapuid'
@40000000455edfcf357bb814                   Searching FS
@40000000455edfcf357c2d44                     2b:value (control/ldapuid)
= '11184'
@40000000455edfcf357cc59c control_readline: Looking for: 'control/ldapgid'
@40000000455edfcf357d3eb4                   Searching FS
@40000000455edfcf357db3e4                     2b:value (control/ldapgid)
= '2110'
@40000000455edfcf357e540c control_readline: Looking for:
'control/ldapmessagestore'
@40000000455edfcf357ed10c                   Searching FS
@40000000455edfcf357f463c                     2b:value
(control/ldapmessagestore) = '/data/maildirs'
@40000000455edfcf358082a4 control_readline: Looking for:
'control/ldapdefaultdotmode'
@40000000455edfcf3580fbbc                   Searching FS
@40000000455edfcf358170ec                     Can't open
control/ldapdefaultdotmode (errno=2)
@40000000455edfcf3581f9a4 control_readline: Looking for:
'control/defaultquotasize'
@40000000455edfcf358276a4                   Searching FS
@40000000455edfcf3582ebd4                     Can't open
control/defaultquotasize (errno=2)
@40000000455edfcf3583748c control_readline: Looking for:
'control/defaultquotacount'
@40000000455edfcf3583eda4                   Searching FS
@40000000455edfcf358462d4                     Can't open
control/defaultquotacount (errno=2)
@40000000455edfcf3584eb8c control_readline: Looking for:
'control/queuelifetime'
@40000000455edfcf35857ffc                   Searching FS
@40000000455edfcf3585f52c                     Can't open
control/queuelifetime (errno=2)
@40000000455edfcf35867de4 control_readline: Looking for:
'control/concurrencylocal'
@40000000455edfcf35873d4c                   Searching FS
@40000000455edfcf3587b27c                     Can't open
control/concurrencylocal (errno=2)
@40000000455edfcf35883b34 control_readline: Looking for:
'control/concurrencyremote'
@40000000455edfcf3588b44c                   Searching FS
@40000000455edfcf3589297c                     Can't open
control/concurrencyremote (errno=2)
@40000000455edfcf3589b234 control_readline: Looking for:
'control/envnoathost'
@40000000455edfcf358a2764                   Searching FS
@40000000455edfcf358a9c94                     Can't open
control/envnoathost (errno=2)
@40000000455edfcf358b3104 control_readline: Looking for:
'control/bouncefrom'
@40000000455edfcf358bae04                   Searching FS
@40000000455edfcf358c2334                     Can't open
control/bouncefrom (errno=2)
@40000000455edfcf358cafd4 control_readline: Looking for:
'control/bouncehost'
@40000000455edfcf358d2cd4                   Searching FS
@40000000455edfcf358da204                     Can't open
control/bouncehost (errno=2)
@40000000455edfcf358e2abc control_readline: Looking for:
'control/doublebouncehost'
@40000000455edfcf358ea7bc                   Searching FS
@40000000455edfcf358f76c4                     Can't open
control/doublebouncehost (errno=2)
@40000000455edfcf358fff7c control_readline: Looking for:
'control/doublebounceto'
@40000000455edfcf35908064                   Searching FS
@40000000455edfcf3590f594                     Can't open
control/doublebounceto (errno=2)
@40000000455edfcf35917e4c control_readline: Looking for:
'control/bouncemaxbytes'
@40000000455edfcf3591ff34                   Searching FS
@40000000455edfcf35927464                     Can't open
control/bouncemaxbytes (errno=2)
@40000000455edfcf3592f934 control_readfile: Looking for: 'control/locals'
@40000000455edfcf3593b89c                   Searching FS
@40000000455edfcf359431b4                     Can't open control/locals
(errno=2)
@40000000455edfcf3594be54                     4b:value (control/locals)
= 'cb1.cb.home' (errno=2)
@40000000455edfcf35958974 control_readfile: Looking for:
'control/percenthack'
@40000000455edfcf3596299c                   Searching FS
@40000000455edfcf3596a2b4 control_readfile: Looking for:
'control/virtualdomains'
@40000000455edfcf3597c3c4                   Searching FS

ldap connection successful but read everything from FS

added debug-code to verify_ldap_file_check and found that this always
gives false

thought this is because
(strstr(fn, "me") == fn)
never will be true because strstr(fn, "me") gives "me" and is never the
same as fn that is "control/me"
so changed the tests in verify_ldap_file_check back to

&& strncmp(fn, "me", 2) && strcmp(fn, "control/me") && strcmp(fn,
"/var/qmail/control/me")
&& strcmp(fn, "ldapserver") && strcmp(fn, "control/ldapserver") &&
strcmp(fn, "/var/qmail/control/ldapserver")
&& strcmp(fn, "ldapcontroldn") && strcmp(fn, "control/ldapcontroldn") &&
strcmp(fn, "/var/qmail/control/ldapcontroldn")
&& strcmp(fn, "ldaplogin") && strcmp(fn, "control/ldaplogin") &&
strcmp(fn, "/var/qmail/control/ldaplogin")
&& strcmp(fn, "ldappassword") && strcmp(fn, "control/ldappassword") &&
strcmp(fn, "/var/qmail/control/ldappassword")
#if defined(SECUREBIND_SASL) || defined(SECUREBIND_SSL) ||
defined(SECUREBIND_TLS) || defined(SECUREBIND_ALL)
&& strcmp(fn, "ldapsecurebind") && strcmp(fn, "control/ldapsecurebind")
&& strcmp(fn, "/var/qmail/control/ldapsecurebind")
#endif

gives in logfile:

@40000000455ee23d371a9b04 control_readline: Looking for: 'control/me'
@40000000455ee23d371aa6bc                   Searching FS
@40000000455ee23d371ba4a4                     2b:value (control/me) =
'cb1.cb.home'
@40000000455ee23d371dd724 control_readline: Looking for:
'control/ldappassword'
@40000000455ee23d371e580c                   Searching FS
@40000000455ee23d371ecd3c                     2a:value
(control/ldappassword) = '<secret>'
@40000000455ee23d371f84d4 control_readline: Looking for: 'control/ldaplogin'
@40000000455ee23d371ffdec                   Searching FS
@40000000455ee23d3720731c                     2b:value
(control/ldaplogin) = 'cn=qmail,ou=systemuser,o=cb-world,c=de'
@40000000455ee23d37211b14 control_readfile: Looking for:
'control/ldapserver'
@40000000455ee23d37219bfc                   Searching FS
@40000000455ee23d3722112c control_readline: Looking for: 'control/port_ldap'
@40000000455ee23d3722dc4c                   Searching FS
@40000000455ee23d3723594c                     Can't open
control/port_ldap (errno=2)
@40000000455ee23d37243fc4 control_readline: Looking for:
'control/ldapcontroldn'
@40000000455ee23d3724c0ac                   Searching FS
@40000000455ee23d372539c4                     2b:value
(control/ldapcontroldn) = 'ou=server,o=cb-world,c=de'
@40000000455ee23d3725e5a4 control_readline: Looking for:
'control/ldapsecurebind'
@40000000455ee23d37265ebc                   Searching FS
@40000000455ee23d3726d3ec                     Can't open
control/ldapsecurebind (errno=2)
@40000000455ee23d3727608c qldap_getcontrols_securebind: retreiving
secure bind options: use_uri=0, use_ssl=0
@40000000455ee23d3728143c                               string2argv:
out[0] = nosecure
@40000000455ee23d3728a4c4                               string2argv:
arguments = 1
@40000000455ee23d3729836c                               done.
@40000000455ee23d3729f89c qldap_ctrl_bind: Allocating memory for LDAP
connection: SUCCESS
@40000000455ee23d372aeacc qldap_ctrl_bind: Opening LDAP connection to
localhost:
@40000000455ee23d372bae1c   qldap_open: use_uri=0, use_ssl=0, use_tls=0
@40000000455ee23d372c2b1c   qldap_open: ldap_init(localhost, 389) -> SUCCESS
@40000000455ee23d373c7314   qldap_set_option: set referrals successful
@40000000455ee23d373d26c4   -> LDAP connection opened successfully
@40000000455ee23d373dfd9c qldap_ctrl_bind: Binding to LDAP server as
cn=qmail,ou=systemuser,o=cb-world,c=de:
@40000000455ee23d373e7a9c   qldap_bind: successful
@40000000455ee23d37522d94
@40000000455ee23d3752317c control_readline: Looking for:
'control/ldapbasedn'
@40000000455ee23d37531024                   Searching LDAP
@40000000455ee23d37538d24                     me:             cb1.cb.home
@40000000455ee23d37540e0c                     Attribute(s):   ldapbasedn
@40000000455ee23d375492dc                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d375df534                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d375e81d4                     1:value
(control/ldapbasedn) = 'c=de'
@40000000455ee23d375f7fbc control_readline: Looking for:
'control/ldapobjectclass'
@40000000455ee23d375ffcbc                   Searching LDAP
@40000000455ee23d376075d4                     me:             cb1.cb.home
@40000000455ee23d3760eb04                     Attribute(s):
ldapobjectclass
@40000000455ee23d37616bec                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d376a7854                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d376b04f4                   Searching FS
@40000000455ee23d376b8dac                     2b:value
(control/ldapobjectclass) = 'qmailuser'
@40000000455ee23d376c6c54 control_readline: Looking for:
'control/ldaptimeout'
@40000000455ee23d376ce954                   Searching LDAP
@40000000455ee23d376d626c                     me:             cb1.cb.home
@40000000455ee23d376dd79c                     Attribute(s):   ldaptimeout
@40000000455ee23d376e5884                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d3776b13c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d377739f4                   Searching FS
@40000000455ee23d3777badc                     Can't open
control/ldaptimeout (errno=2)
@40000000455ee23d37785334 control_readline: Looking for:
'control/ldaprebind'
@40000000455ee23d3778cc4c                   Searching LDAP
@40000000455ee23d37794564                     me:             cb1.cb.home
@40000000455ee23d3779be7c                     Attribute(s):   ldaprebind
@40000000455ee23d377a3f64                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d3781ccfc                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d378255b4                   Searching FS
@40000000455ee23d3782d69c                     Can't open
control/ldaprebind (errno=2)
@40000000455ee23d37836724 control_readline: Looking for: 'control/ldapuid'
@40000000455ee23d3783e03c                   Searching LDAP
@40000000455ee23d37845954                     me:             cb1.cb.home
@40000000455ee23d3784ce84                     Attribute(s):   ldapuid
@40000000455ee23d37854f6c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d378ce0ec                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d378d65bc                     1:value (control/ldapuid)
= '11184'
@40000000455ee23d378dfa2c control_readline: Looking for: 'control/ldapgid'
@40000000455ee23d378e7344                   Searching LDAP
@40000000455ee23d378eec5c                     me:             cb1.cb.home
@40000000455ee23d378fa3f4                     Attribute(s):   ldapgid
@40000000455ee23d379028c4                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d3797c9e4                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37984eb4                     1:value (control/ldapgid)
= '2110'
@40000000455ee23d3798df3c control_readline: Looking for:
'control/ldapmessagestore'
@40000000455ee23d37995c3c                   Searching LDAP
@40000000455ee23d379a3314                     me:             cb1.cb.home
@40000000455ee23d379aac2c                     Attribute(s):
ldapmessagestore
@40000000455ee23d379b30fc                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37a2f15c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37a3762c                     1:value
(control/ldapmessagestore) = '/data/maildirs'
@40000000455ee23d37a40a9c control_readline: Looking for:
'control/ldapdefaultdotmode'
@40000000455ee23d37a4879c                   Searching LDAP
@40000000455ee23d37a4fccc                     me:             cb1.cb.home
@40000000455ee23d37a66814                     Attribute(s):
ldapdefaultdotmode
@40000000455ee23d37a6f4b4                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37af9f74                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37b0282c                   Searching FS
@40000000455ee23d37b0acfc                     Can't open
control/ldapdefaultdotmode (errno=2)
@40000000455ee23d37b14d24 control_readline: Looking for:
'control/defaultquotasize'
@40000000455ee23d37b1ce0c                   Searching LDAP
@40000000455ee23d37b24724                     me:             cb1.cb.home
@40000000455ee23d37b2c03c                     Attribute(s):
defaultquotasize
@40000000455ee23d37b34124                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37bb0954                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37bb8e24                   Searching FS
@40000000455ee23d37bc0f0c                     Can't open
control/defaultquotasize (errno=2)
@40000000455ee23d37bca764 control_readline: Looking for:
'control/defaultquotacount'
@40000000455ee23d37bd207c                   Searching LDAP
@40000000455ee23d37bd9994                     me:             cb1.cb.home
@40000000455ee23d37be0ec4                     Attribute(s):
defaultquotacount
@40000000455ee23d37be8fac                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37c79ffc                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37c82c9c                   Searching FS
@40000000455ee23d37c8ad84                     Can't open
control/defaultquotacount (errno=2)
@40000000455ee23d37c96134 control_readline: Looking for:
'control/queuelifetime'
@40000000455ee23d37ca0d14                   Searching LDAP
@40000000455ee23d37ca862c                     me:             cb1.cb.home
@40000000455ee23d37caff44                     Attribute(s):   queuelifetime
@40000000455ee23d37cb802c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37d41f34                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37d4abd4                     1:value
(control/queuelifetime) = '259200'
@40000000455ee23d37d5442c control_readline: Looking for:
'control/concurrencylocal'
@40000000455ee23d37d5bd44                   Searching LDAP
@40000000455ee23d37d6365c                     me:             cb1.cb.home
@40000000455ee23d37d6af74                     Attribute(s):
concurrencylocal
@40000000455ee23d37d7305c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37dedd34                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37df65ec                   Searching FS
@40000000455ee23d37dfeabc                     Can't open
control/concurrencylocal (errno=2)
@40000000455ee23d37e08314 control_readline: Looking for:
'control/concurrencyremote'
@40000000455ee23d37e0fc2c                   Searching LDAP
@40000000455ee23d37e17544                     me:             cb1.cb.home
@40000000455ee23d37e24064                     Attribute(s):
concurrencyremote
@40000000455ee23d37e30f6c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37eb50b4                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37ebdd54                     1:value
(control/concurrencyremote) = '80'
@40000000455ee23d37ec71c4 control_readline: Looking for:
'control/envnoathost'
@40000000455ee23d37eceec4                   Searching LDAP
@40000000455ee23d37ed63f4                     me:             cb1.cb.home
@40000000455ee23d37eddd0c                     Attribute(s):   envnoathost
@40000000455ee23d37ee5df4                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d37f5fb2c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d37f683e4                   Searching FS
@40000000455ee23d37f704cc                     Can't open
control/envnoathost (errno=2)
@40000000455ee23d37f7a10c control_readline: Looking for:
'control/bouncefrom'
@40000000455ee23d37f821f4                   Searching LDAP
@40000000455ee23d37f89b0c                     me:             cb1.cb.home
@40000000455ee23d37f91424                     Attribute(s):   bouncefrom
@40000000455ee23d37f9950c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d38019fa4                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d3802285c                   Searching FS
@40000000455ee23d3802ad2c                     Can't open
control/bouncefrom (errno=2)
@40000000455ee23d38033db4 control_readline: Looking for:
'control/bouncehost'
@40000000455ee23d3803bab4                   Searching LDAP
@40000000455ee23d380437b4                     me:             cb1.cb.home
@40000000455ee23d3804ace4                     Attribute(s):   bouncehost
@40000000455ee23d38052dcc                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d380cf5fc                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d380d7eb4                   Searching FS
@40000000455ee23d380dff9c                     Can't open
control/bouncehost (errno=2)
@40000000455ee23d380e97f4 control_readline: Looking for:
'control/doublebouncehost'
@40000000455ee23d380f18dc                   Searching LDAP
@40000000455ee23d380f91f4                     me:             cb1.cb.home
@40000000455ee23d38100ef4                     Attribute(s):
doublebouncehost
@40000000455ee23d38108fdc                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d38182d14                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d3818b1e4                   Searching FS
@40000000455ee23d381936b4                     Can't open
control/doublebouncehost (errno=2)
@40000000455ee23d3819cb24 control_readline: Looking for:
'control/doublebounceto'
@40000000455ee23d381a4c0c                   Searching LDAP
@40000000455ee23d381ac524                     me:             cb1.cb.home
@40000000455ee23d381b3e3c                     Attribute(s):   doublebounceto
@40000000455ee23d381bbf24                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d38248d0c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d382519ac                     1:value
(control/doublebounceto) = 'bounce_admin'
@40000000455ee23d3825b5ec control_readline: Looking for:
'control/bouncemaxbytes'
@40000000455ee23d382632ec                   Searching LDAP
@40000000455ee23d3826ac04                     me:             cb1.cb.home
@40000000455ee23d3827251c                     Attribute(s):   bouncemaxbytes
@40000000455ee23d3827a604                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d382f915c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d3830644c                   Searching FS
@40000000455ee23d3830ed04                     Can't open
control/bouncemaxbytes (errno=2)
@40000000455ee23d38318944 control_readfile: Looking for: 'control/locals'
@40000000455ee23d383240dc                   Searching LDAP
@40000000455ee23d3832b9f4                     me:             cb1.cb.home
@40000000455ee23d38332f24                     Attribute(s):   locals
@40000000455ee23d3833b00c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d383b83f4                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d383c0cac                     3:value ((null pointer)) =
'cb-world.decb.homecb1.cb.home'
@40000000455ee23d383ca8ec control_readfile: Looking for:
'control/percenthack'
@40000000455ee23d383d740c                   Searching LDAP
@40000000455ee23d383df10c                     me:             cb1.cb.home
@40000000455ee23d383e6a24                     Attribute(s):   percenthack
@40000000455ee23d383eeb0c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d3846e21c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d38476ad4                   Searching FS
@40000000455ee23d3847efa4                     Can't open (null pointer)
(errno=14)
@40000000455ee23d3848af0c alert: cannot start: unable to read controls

now it reads available controls from ldap but stops with unable to read
controls at percenthack.
percenthack in the logs is:

@40000000455ee23d383ca8ec control_readfile: Looking for:
'control/percenthack'
@40000000455ee23d383d740c                   Searching LDAP
@40000000455ee23d383df10c                     me:             cb1.cb.home
@40000000455ee23d383e6a24                     Attribute(s):   percenthack
@40000000455ee23d383eeb0c                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee23d3846e21c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee23d38476ad4                   Searching FS
@40000000455ee23d3847efa4                     Can't open (null pointer)
(errno=14)

there is no percenthack in ldap so it searches FS but there is no more
'control/percenthack' but (null pointer)
played a bit with the code an found that fn in control_readfile is lost
after control_ldap_search
found no reason why this happens

google found
http://www.opensubscriber.com/message/qmail-ldap@qmail-ldap.org/3767370.html
and
http://www.opensubscriber.com/message/qmail-ldap@qmail-ldap.org/1409631.html

readed everything, also docs again. ldap-connection as user in ldaplogin
with password in ldappassword
and also ldapbasedn seems to be ok, connected to ldap-server localhost
as cn=qmail,ou=systemuser,o=cb-world,c=de
and searches below ou=server,o=cb-world,c=de with
(&(cn=cb1.cb.home)(objectclass=qmailControl)) and also
find it. after this searches FS with (null pointer) for fn instead of
'control/percenthack'
this is the same as in
http://www.opensubscriber.com/message/qmail-ldap@qmail-ldap.org/1409631.html

so added percenthack and also virtualdomains to ldap, started ok:

@40000000455ee5d439cc41cc                     Attribute(s):   percenthack
@40000000455ee5d439cc5554                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee5d439cc593c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee5d439cc610c                     3:value ((null pointer)) =
'cb.home'
@40000000455ee5d439cc64f4 control_readfile: Looking for:
'control/virtualdomains'
@40000000455ee5d439cc6cc4                   Searching LDAP
@40000000455ee5d439cc7c64                     me:             cb1.cb.home
@40000000455ee5d439cc9f8c                     Attribute(s):   virtualdomains
@40000000455ee5d439cca374                     BaseDN:
ou=server,o=cb-world,c=de
@40000000455ee5d439cca75c                     search for
(&(cn=cb1.cb.home)(objectclass=qmailControl)) succeeded in qldap_lookup()
@40000000455ee5d439ccaf2c                     3:value ((null pointer)) =
'cb.home'

but gives:
@40000000455ee5d439ccaf2c                     3:value ((null pointer)) =
'cb.home'

so like befor fn is not set after control_ldap_search anymore

tried to make smtp-connection, failed with:
pbscheck unable to read controls

this also happens because
       if (control_readfile(&addresses,"control/pbsservers",0) != 1)
fails because there is no pbsservers in ldap but in FS and fn is null
pointer in control_readfile
after control_ldap_search

started from scratch without setting SECUREBIND in Makefile (don't need
this because LDAPSERVER
is on same host as qmail)

this gives:

control.c: In Funktion »control_ldap_search«:
control.c:408: Warnung: Unverträgliche implizite Deklaration der
eingebauten Funktion »strndup«
control.c:463: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
Typkonvertierung
control.c: Auf höchster Ebene:
control.c:672: Fehler: In Konflikt stehende Typen für »flatten_attrib_array«
control.c:390: Fehler: Vorherige implizite Deklaration von
»flatten_attrib_array« war hier

so changed control.c from line 68 to 69 from:
char *flatten_attrib_array(const char *attrs[]);
#endif

(#endif is from #if defined(SECUREBIND_SASL) || defined(SECUREBIND_SSL)
|| defined(SECUREBIND_TLS) || defined(SECUREBIND_ALL))
to

#endif
char *flatten_attrib_array(const char *attrs[]);

compiles fine, same problem with verify_ldap_file_check so changed this
as explained above
to
&& strncmp(fn, "me", 2) && strcmp(fn, "control/me") && strcmp(fn,
"/var/qmail/control/me")
&& strcmp(fn, "ldapserver") && strcmp(fn, "control/ldapserver") &&
strcmp(fn, "/var/qmail/control/ldapserver")
&& strcmp(fn, "ldapcontroldn") && strcmp(fn, "control/ldapcontroldn") &&
strcmp(fn, "/var/qmail/control/ldapcontroldn")
&& strcmp(fn, "ldaplogin") && strcmp(fn, "control/ldaplogin") &&
strcmp(fn, "/var/qmail/control/ldaplogin")
&& strcmp(fn, "ldappassword") && strcmp(fn, "control/ldappassword") &&
strcmp(fn, "/var/qmail/control/ldappassword")
#if defined(SECUREBIND_SASL) || defined(SECUREBIND_SSL) ||
defined(SECUREBIND_TLS) || defined(SECUREBIND_ALL)
&& strcmp(fn, "ldapsecurebind") && strcmp(fn, "control/ldapsecurebind")
&& strcmp(fn, "/var/qmail/control/ldapsecurebind")
#endif

same problem with control_readfile again (after control_ldap_search fn
becomes null pointer)

all tests on gentoo with gcc (GCC) 4.1.1 (Gentoo 4.1.1-r1) without any
CFLAGS set

tried everything again on debian with gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)

same problem with str_diffn without DEBUG=-DDEBUG

same problem with verify_ldap_file_check so changed it as above

no other problem found

<Prev in Thread] Current Thread [Next in Thread>