cURL / Mailing Lists / curl-library / Single Mail

curl-library

R: Re: Problem with LDAP access through SOCKS v4/v5

From: <sergio.cavaglia_at_tiscali.it>
Date: Thu, 23 Oct 2008 17:38:44 +0200 (CEST)

Dear Daniel,

I dbuged the libcurl 7.19.0

and I noticed first of all
that
in the function Curl_ldap, the instruction

server = ldap_init
(conn->host.name, (int)conn->port);

made the LDAP initialization using
(int)conn->port that correspond to the socks server port.

Is it
correct?
Is not better that this function makes the initialization
using the variable
(int)conn->remote_port, corresponding to the LDAP
server port 389?

Debugging the function Curl_ldap, i got a first
error from function:

 rc = ldap_simple_bind_s(server, conn->bits.
user_passwd ? conn->user : NULL, conn->bits.user_passwd ? conn->passwd
: NULL);

I am sure I don't need any authentification and I get the
error:

rc = 81;

server
        ld_sb {...}
        
ld_host 0x00000000 ""
        ld_version 3
        
ld_lberoptions 1 ''
        ld_deref 0
        ld_timelimit
0
        ld_sizelimit 0
        ld_errno 81
        
ld_matched 0x00000000 ""
        ld_error 0x76f47eec
"Server not accessible"
        ld_msgid 0
        
Reserved3 0x00149570 ""
        ld_cldaptries 4
        
ld_cldaptimeout 3
        ld_refhoplimit 32
        ld_options 99

Being the rc != 0 true
the function Curl_ldap runs the following code:

ldap_proto = LDAP_VERSION2;
ldap_set_option(server,
LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
rc = ldap_simple_bind_s
(server, conn->bits.user_passwd ? conn->user : NULL, conn->bits.
user_passwd ? conn->passwd : NULL);

At this point i get the error:

rc
= 52;

server
        ld_sb {...}
        ld_host
0x00000000 ""
        ld_version 2
        ld_lberoptions 1 ''

        ld_deref 0
        ld_timelimit 0
        
ld_sizelimit 0
        ld_errno 52
        ld_matched
0x00000000 ""
        ld_error 0x76f47398 "Not available"

        ld_msgid 0
        Reserved3 0x00149570 ""
        
ld_cldaptries 4
        ld_cldaptimeout 3
        ld_refhoplimit 32

        ld_options 99

and the function Curl_ldap ends setting

status = CURLE_LDAP_CANNOT_BIND; (38)

and showing the message:

* LDAP
local: ldap_simple_bind_s Not available
Curl lib returned value: 38.
LDAP: cannot bind

I got the same errors also using the instruction:

server = ldap_init(conn->host.name, (int)conn->remote_port);
instead of

server = ldap_init(conn->host.name, (int)conn->port);

I am using:

Version CURLLIB: libcurl/7.19.0
 LDAP local: LDAP Vendor = Microsoft
Corporation. ; LDAP Version = 510
OS Win Xp Sp 3;
Visual studio 6 Sp 6
with Microsoft Platform SDK February 2003

Could anyone help me
please?
Thanks
Sergio

----Messaggio originale----
Da: daniel_at_haxx.se

Data: 14/10/2008 22.24
A: "libcurl development"<curl-library_at_cool.haxx.
se>
Ogg: Re: Problem with LDAP access through SOCKS v4/v5

On Tue, 14
Oct 2008, sergio.cavaglia_at_tiscali.it wrote:

> error: curl: (38) LDAP
local:
> ldap_simple_bind_s Not available.

You're one in a series of
people all reporting the same problem, but nobody
has yet figured out
the reason nor the fix as far as I know.

I'd suggest you single-step
through the ldap code with a debugger to figure it
out and then try to
address the problem.

-- 
  / daniel.haxx.se
_______________________________________________________________
Con Tiscali Adsl 8 Mega navighi SENZA LIMITI e GRATIS PER I PRIMI TRE MESI. In seguito paghi solo € 19,95 al mese. Attivala subito, l’offerta è valida fino al 23/10/2008! http://abbonati.tiscali.it/promo/adsl8mega/
Received on 2008-10-23