[Date Prev][Date Next] [Chronological] [Thread] [Top]

Error code -12 with ldap_sasl_bind



Hello,

In the following debug snippet I make an ldap_intit and an
ldap_sasl_bind_s afterwards. In the end an unbind follows.

My problem is, that I get an error code '-12' for the ldap_sasl_bind.
Does anyone has a clue why the bin doesnt work?

Mar  8 12:03:06 matrix slapd[3505]: conn=3 fd=15 ACCEPT from
IP=[::1]:56601 (IP=[::]:389)
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on 1 descriptor
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on:
Mar  8 12:03:06 matrix slapd[3505]:
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=8
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=9
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=10
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on 1 descriptor
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on:
Mar  8 12:03:06 matrix slapd[3505]:  15r
Mar  8 12:03:06 matrix slapd[3505]:
Mar  8 12:03:06 matrix slapd[3505]: daemon: read active on 15
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=8
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=9
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=10
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: connection_get(15)
Mar  8 12:03:06 matrix slapd[3505]: connection_get(15): got connid=3
Mar  8 12:03:06 matrix slapd[3505]: connection_read(15): checking for
input on id=3
Mar  8 12:03:06 matrix slapd[3505]: op tag 0x42, time 1268046186

======== I think here is the problem
Mar  8 12:03:06 matrix slapd[3505]: ber_get_next on fd 15 failed
errno=0 (Success)
Mar  8 12:03:06 matrix slapd[3505]: connection_read(15): input
error=-2 id=3, closing.
========

Mar  8 12:03:06 matrix slapd[3505]: connection_closing: readying
conn=3 sd=15 for close
Mar  8 12:03:06 matrix slapd[3505]: connection_close: deferring conn=3 sd=15
Mar  8 12:03:06 matrix slapd[3505]: conn=3 op=0 do_unbind
Mar  8 12:03:06 matrix slapd[3505]: conn=3 op=0 UNBIND
Mar  8 12:03:06 matrix slapd[3505]: connection_resched: attempting
closing conn=3 sd=15
Mar  8 12:03:06 matrix slapd[3505]: connection_close: conn=3 sd=15
Mar  8 12:03:06 matrix slapd[3505]: daemon: removing 15
Mar  8 12:03:06 matrix slapd[3505]: conn=3 fd=15 closed
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on 1 descriptor
Mar  8 12:03:06 matrix slapd[3505]: daemon: activity on:
Mar  8 12:03:06 matrix slapd[3505]:
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=8
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=9
active_threads=0 tvp=zero
Mar  8 12:03:06 matrix slapd[3505]: daemon: epoll: listen=10
active_threads=0 tvp=zero


Since I try to build up a ruby Binding for OpenLdap with ffi I dont
have c code here, but the ruby snippet is:

handle = ldap_init "localhost", 389
res = ldap_sasl_bind_s handle, 'cn=admin,ou=users,dc=thilko,dc=net',
'', 'x', nil, nil, nil
p " the result: #{res}"

and the result is '-12'. Note that I am using ffi, so the function
'ldap_sasl_bind_s' is a call to the native function defined in ldap.h.
I try to use LDAP_SASL_SIMPLE.

I also tried to use a ber_val struct as password and servercred - the
same effect. I stepped through some source code in openLdap, but I
dont know where the error code '-12' comes from and where to find some
documentation.


Thx a lot for help,


Thilko