Please reply on the mailing list.
On 05/16/2013 01:00 AM, Benin Technologies wrote:
yes but...where is this perl function called for binds ??? it isn't in SampleLDAP.pm...
servers/slapd/back-perl/bind.c calls a method "bind" as much as servers/slapd/back-perl/search.c calls a method "search". Apparently, who wrote "SampleLDAP.pm" did not provide a "bind" example. Note that I've been working for 15 years with OpenLDAP and I never used back-perl; I discovered all of this last night by opening 2 files and reading about 10 lines of code. You should probably try to do something like this yourself.
p.
Le 15/05/2013 22:20, Pierangelo Masarati a écrit :
binddn and bindpw are the first two parameters of the perl function called for binds.
I'm sorry, but I've only been working with openldap for a few months, and I'm not exactly a C expert neither...
However, I had the idea at the beginning to write my own bind() function in SampleLDAP.pm, hoping it would somehow be called, but it wasn't :
I wrote : sub bind { print {*STDERR} "Here in bind\n"; return 0; }
It's never called : when I start slapd I can see that new() and init() are called, then when I do a search I can see that search() is called, but apparently the bind() function I wrote in SampleLDAP.pm is never called
root@ldap:/# /usr/local/libexec/slapd -u openldap -g openldap -h "ldap:/// ldapi:///" -d 0 Here in new Here in init Here in search
Le 16/05/2013 06:24, Pierangelo Masarati a écrit :
servers/slapd/back-perl/bind.c calls a method "bind" as much as servers/slapd/back-perl/search.c calls a method "search". Apparently, who wrote "SampleLDAP.pm" did not provide a "bind" example. Note that I've been working for 15 years with OpenLDAP and I never used back-perl; I discovered all of this last night by opening 2 files and reading about 10 lines of code. You should probably try to do something like this yourself.
p.
Le 15/05/2013 22:20, Pierangelo Masarati a écrit :
binddn and bindpw are the first two parameters of the perl function called for binds.
by the way you're right there IS a call to bind() in bind.c on line 57
count = call_method("bind", G_SCALAR);
it just seems that if I define a bind() function in SampleLDAP.pm, it's never called, despite of that call
strange
I'm sorry, but I've only been working with openldap for a few months, and I'm not exactly a C expert neither...
However, I had the idea at the beginning to write my own bind() function in SampleLDAP.pm, hoping it would somehow be called, but it wasn't :
I wrote : sub bind { print {*STDERR} "Here in bind\n"; return 0; }
It's never called : when I start slapd I can see that new() and init() are called, then when I do a search I can see that search() is called, but apparently the bind() function I wrote in SampleLDAP.pm is never called
root@ldap:/# /usr/local/libexec/slapd -u openldap -g openldap -h "ldap:/// ldapi:///" -d 0 Here in new Here in init Here in search
Le 16/05/2013 06:24, Pierangelo Masarati a écrit :
servers/slapd/back-perl/bind.c calls a method "bind" as much as servers/slapd/back-perl/search.c calls a method "search". Apparently, who wrote "SampleLDAP.pm" did not provide a "bind" example. Note that I've been working for 15 years with OpenLDAP and I never used back-perl; I discovered all of this last night by opening 2 files and reading about 10 lines of code. You should probably try to do something like this yourself.
p.
Le 15/05/2013 22:20, Pierangelo Masarati a écrit :
binddn and bindpw are the first two parameters of the perl function called for binds.
On 2013-05-16 11:14, Benin Technologies wrote:
I wrote : sub bind { print {*STDERR} "Here in bind\n"; return 0; }
It's never called : when I start slapd I can see that new() and init() are called, then when I do a search I can see that search() is called, but apparently the bind() function I wrote in SampleLDAP.pm is never called
Are you binding with the rootdn/rootpw? back-ldap/bind.c handles these specially, with be_rootdn_bind(). If so, try another DN and password.
bingo !!!! that was it !!!!
bind() isn't called with the rootdn/rootpw but with any other dn/pw it's called, now I can get the credentials int the perl script
MANY MANY thanks
Ben
Le 16/05/2013 11:23, Hallvard Breien Furuseth a écrit :
On 2013-05-16 11:14, Benin Technologies wrote:
I wrote : sub bind { print {*STDERR} "Here in bind\n"; return 0; }
It's never called : when I start slapd I can see that new() and init() are called, then when I do a search I can see that search() is called, but apparently the bind() function I wrote in SampleLDAP.pm is never called
Are you binding with the rootdn/rootpw? back-ldap/bind.c handles these specially, with be_rootdn_bind(). If so, try another DN and password.
openldap-technical@openldap.org