[Date Prev][Date Next]
Re: ldap_set_option/ldap_bind_s segfaults
On Dec 30, 2007, at 19:39 , Pierangelo Masarati wrote:
On Dec 29, 2007, at 16:27 , Pierangelo Masarati wrote:
Johan Ström wrote:
Im trying to run pure-ftpd 1.0.21 on a FreeBSD 7.0-amd64
Since your arch is 64 bit, and that piece of code is using a lot of
function calls whose declaration in ldap.h is hidden behind
LDAP_DEPRECATED (ldap_init(), ldap_bind_s()), you should declare
macro (e.g. manually add -DLDAP_DEPRECATED=1 in the Makefile where
LDAP-related code is built) when building the client, so the
declarations become visible.
Hi, thanks for your answer!
That would only solve any compile time problems, right? And I got no
problems with compiling.. Altough I tried to add
You definitely have a compile time problem if you use undefined
since in C undefined types default to int (32 bits) while pointers
have word size (64 bits on 64 bit archs).
#define LDAP_DEPRICATED 1
There's a typo in the above; the correct macro name is LDAP_DEPRECATED
right before the ldap.h/lber.h includes just to test, but no
difference.. Still segfaults.
I could try to change the ldap_bind_s to ldap_sasl_bind, but that
wouldnt help since it crashes on the ldap_set_version, and that call
isn't depricated, right?
No, it's not. But ldap_init() is, and your issue could start there.
I have tried with 3, 2, and 1 as versions just to test, no difference
at all.. Always crashes.
Please fix the above issues and retry. And pump up the compile-time
warnings to get some useful information from the compiler itself (e.g.
-Wall with gcc).
Thanks! that solved the issue.. I'm used to work on -Werror in
Makefiles.. So undefined functions would stop instead of just warn.
So with the correct define (without typo.. /me slaps himself) it now
compiles without warnings (which I missed before). And now it works
Will submit patch to pure-ftpd team..