Qmail-LDAP
[Top] [All Lists]

Re: Compile qmail-ldap-control in Fedora 6 environment (GCC 4.1.1 has bu

To: qmail-ldap@qmail-ldap.org
Subject: Re: Compile qmail-ldap-control in Fedora 6 environment (GCC 4.1.1 has bug?)
From: Turbo Fredriksson <turbo@bayour.com>
Date: Tue, 20 Mar 2007 20:09:47 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: qmail-ldap-list@securepoint.com
Delivered-to: mailing list qmail-ldap@qmail-ldap.org
In-reply-to: <20070318114319.7663.qmail@gold.hongkong1.com> (Steve Chan's message of "Sun, 18 Mar 2007 19:38:20 +0800")
Mailing-list: contact qmail-ldap-help@qmail-ldap.org; run by ezmlm
Organization: QMail LDAP expert wannabe
References: <20070318114319.7663.qmail@gold.hongkong1.com>
Sender: Turbo Fredriksson <turbo@pumba>
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/20.7 (gnu/linux)
Quoting Steve Chan <steve@hongkong1.com>:

> In Fedora 6 environment, I patched original qmail 1.03
> (qmail-1.03.tar.gz) with qmail-ldap-1.03-20060201.patch, then with
> qmail-ldap-1.03-20060201-controls20060403b.

>  I failed to compile it.

Why not?

> 1.  Commented out "extern unsigned sasl_flags;" in control.h.  It
> seems that sasl_flags are defined as static in all programs using this
> header file.

Which is absolute nonsense... Sorry, but it is.

If you don't want SASL, don't enable SECUREBIND. The fix is THAT
simpe... Simpler than hacking the code to disable it (which you where
doing)...

> 2.  Replaced function verify_ldap_file_check with old source code (use
> strcmp instead of strstr).

Why?

>  The strstr code has bug.

In what way?

> 3.  Included str_diffn.o in the qmail-newmrh section of Makefile.
> Someone suggested this change in this newgroup.

Why (see below)?

> After a lot of debug tracing, I found that the value of "fn" was
> cleared after called to "control_ldap_search" in the control_readfile
> function.  Someone already mentioned this point in this newsgroup
> before.  At last, I disabled the gcc optimization option (I removed
> "-O2" from file conf-cc) and everything work fine.

If you can remove your 'fixes' and try again and see if you still get
the same problem I'm happy to discuss this. There ARE bugs here and there,
but most (?) of this seems to come from faulty/missing #ifdef's (I'm 
not compiling with the same options as any one else it seems :).

I've been running this exact code for almost a year now on multiple machines
without problem, so... ?

>  #if defined(SECUREBIND_SASL) || defined(SECUREBIND_ALL)
> -extern unsigned sasl_flags;
> +//extern unsigned sasl_flags;

As you can see... if you hadn't enabled SECUREBIND_SASL and/or
SECUREBIND_ALL this wouldn't happen...

> @@ -1759,7 +1761,7 @@
>  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 \
> +     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)

Why this? This however looks like a fix I've seen before, but can't
remember if I could reproduce...



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