[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
MySql backend error
Dear All,
I'm trying to make Mysql (4.0.13) work as backend for openldap (2.1.22) on
Trustix 2.0.
I compiled openldap enabling SQL support.
Installed the package and loaded the Test DB in Mysql.
I'm using iodbc as odbc driver for Mysql as suggested here:
http://www.flatmtn.com/computer/Linux-mySQL.html
Tested the odbc driver and working fine.
This is my Slapd config file: /etc/openldap/slapd.conf
####
All schema
####
loglevel 5
access to * by * write
has_ldapinfo_dn_ru no
#######################################################################
# sql database definitions - Test DB
#######################################################################
database sql
suffix "o=sql,c=RU"
rootdn "cn=root,o=sql,c=RU"
#rootpw secret
rootpw {SHA}5en6G6MezRroT3XKqkdPOmY/BfQ=
dbname ldap_test
dbuser root
dbpasswd secret
subtree_cond "ldap_entries.dn LIKE CONCAT('%',?)"
insentry_query "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval)
VALUES (?
,?,?,?)"
When I start splad as follow: slapd -d 239 -f /etc/openldap/slapd.conf -u
slapd -g slapd
Everythign looks OK:
==>backsql_close_db_conn()
<==backsql_close_db_conn()
<==backsql_free_db_conn()
<==backsql_db_open(): test succeeded, schema map loaded
slapd starting
daemon: added 6r
daemon: select: listen=6 active_threads=0 tvp=NULL
Now if I try to connect to it and browse the tree with LdapBrowser I get the
following results:
daemon: activity on 1 descriptors
daemon: new connection on 9
daemon: added 9r
daemon: activity on:
daemon: select: listen=6 active_threads=0 tvp=NULL
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=3
connection_read(9): checking for input on id=3
ber_get_next
ldap_read: want=8, got=8
0000: 30 24 02 01 01 60 1f 02 0$...`..
ldap_read: want=30, got=30
0000: 01 03 04 12 63 6e 3d 72 6f 6f 74 2c 6f 3d 73 71 ....cn=root,o=sq
0010: 6c 2c 63 3d 52 55 80 06 73 65 63 72 65 74 l,c=RU..secret
ber_get_next: tag 0x30 len 36 contents:
ber_get_next
ldap_read: want=8 error=Resource temporarily unavailable
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
daemon: select: listen=6 active_threads=1 tvp=NULL
do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt (m}) ber:
>>> dnPrettyNormal: <cn=root,o=sql,c=RU>
=> ldap_bv2dn(cn=root,o=sql,c=RU,0)
<= ldap_bv2dn(cn=root,o=sql,c=RU,0)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(cn=root,o=sql,c=RU,272)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(cn=root,o=sql,c=ru,272)=0
<<< dnPrettyNormal: <cn=root,o=sql,c=RU>, <cn=root,o=sql,c=ru>
do_bind: version=3 dn="cn=root,o=sql,c=RU" method=128
==>backsql_bind()
<==backsql_bind() root bind
do_bind: v3 bind: "cn=root,o=sql,c=RU" to "cn=root,o=sql,c=RU"
send_ldap_result: conn=3 op=0 p=3
send_ldap_result: err=0 matched="" text=""
send_ldap_response: msgid=1 tag=97 err=0
ber_flush: 14 bytes to sd 9
0000: 30 0c 02 01 01 61 07 0a 01 00 04 00 04 00 0....a........
ldap_write: want=14, written=14
0000: 30 0c 02 01 01 61 07 0a 01 00 04 00 04 00 0....a........
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=3
connection_read(9): checking for input on id=3
ber_get_next
ldap_read: want=8, got=8
0000: 30 59 02 01 02 63 37 04 0Y...c7.
ldap_read: want=83, got=83
0000: 0a 6f 3d 73 71 6c 2c 63 3d 52 55 0a 01 01 0a 01 .o=sql,c=RU.....
0010: 03 02 01 00 02 01 00 01 01 00 87 0b 6f 62 6a 65 ............obje
0020: 63 74 63 6c 61 73 73 30 0d 04 0b 6f 62 6a 65 63 ctclass0...objec
0030: 74 63 6c 61 73 73 a0 1b 30 19 04 17 32 2e 31 36 tclass..0...2.16
0040: 2e 38 34 30 2e 31 2e 31 31 33 37 33 30 2e 33 2e .840.1.113730.3.
0050: 34 2e 32 4.2
ber_get_next: tag 0x30 len 89 contents:
ber_get_next
ldap_read: want=8 error=Resource temporarily unavailable
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
daemon: select: listen=6 active_threads=1 tvp=NULL
do_search
ber_scanf fmt ({miiiib) ber:
>>> dnPrettyNormal: <o=sql,c=RU>
=> ldap_bv2dn(o=sql,c=RU,0)
<= ldap_bv2dn(o=sql,c=RU,0)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(o=sql,c=RU,272)=0
=> ldap_dn2bv(272)
<= ldap_dn2bv(o=sql,c=ru,272)=0
<<< dnPrettyNormal: <o=sql,c=RU>, <o=sql,c=ru>
SRCH "o=sql,c=RU" 1 3 0 0 0
begin get_filter
PRESENT
ber_scanf fmt (m) ber:
end get_filter 0
filter: (objectClass=*)
ber_scanf fmt ({M}}) ber:
=> get_ctrls
ber_scanf fmt ({a) ber:
=> get_ctrls: oid="2.16.840.1.113730.3.4.2" (noncritical)
<= get_ctrls: n=1 rc=0 err=""
attrs: objectclass
==>backsql_search(): base='o=sql,c=ru', filter='(objectClass=*)', scope=1,
deref=3, attrsonly=0, attributes to load: custom list
==>backsql_get_db_conn()
==>backsql_open_db_conn()
backsql_open_db_conn(): connected, adding to tree
<==backsql_open_db_conn()
<==backsql_get_db_conn()
==>backsql_attrlist_add(): adding 'objectClass' to list
==>backsql_oc_get_candidates(): oc='organization'
==>backsql_srch_query()
==>backsql_process_filter()
==>backsql_attrlist_add(): attribute 'objectClass' is in list
<==backsql_process_filter()
<==backsql_srch_query()
Constructed query: SELECT DISTINCT
ldap_entries.id,institutes.id,'organization' AS objectClass,ldap_entries.dn
AS dn FROM ldap_entries,institutes WHERE institutes.id=ldap_entries.keyval
AND ldap_entries.oc_map_id=? AND ldap_entries.parent=? AND NOT
('organization' IS NULL)
==>backsql_dn2id(): dn='o=sql,c=ru'
id_query 'SELECT id,keyval,oc_map_id FROM ldap_entries WHERE dn=?'
==>backsql_dn2id(): upperdn='UR=C,LQS=O'
<==backsql_dn2id(): no match
backsql_oc_get_candidates(): could not retrieve base_dn id: no such entry
==>backsql_oc_get_candidates(): oc='document'
==>backsql_srch_query()
==>backsql_process_filter()
==>backsql_attrlist_add(): attribute 'objectClass' is in list
<==backsql_process_filter()
<==backsql_srch_query()
Constructed query: SELECT DISTINCT ldap_entries.id,documents.id,'document'
AS objectClass,ldap_entries.dn AS dn FROM ldap_entries,documents WHERE
documents.id=ldap_entries.keyval AND ldap_entries.oc_map_id=? AND
ldap_entries.parent=? AND NOT ('document' IS NULL)
==>backsql_dn2id(): dn='o=sql,c=ru'
id_query 'SELECT id,keyval,oc_map_id FROM ldap_entries WHERE dn=?'
==>backsql_dn2id(): upperdn='UR=C,LQS=O'
<==backsql_dn2id(): no match
backsql_oc_get_candidates(): could not retrieve base_dn id: no such entry
==>backsql_oc_get_candidates(): oc='inetOrgPerson'
==>backsql_srch_query()
==>backsql_process_filter()
==>backsql_attrlist_add(): attribute 'objectClass' is in list
<==backsql_process_filter()
<==backsql_srch_query()
Constructed query: SELECT DISTINCT
ldap_entries.id,persons.id,'inetOrgPerson' AS objectClass,ldap_entries.dn AS
dn FROM ldap_entries,persons WHERE persons.id=ldap_entries.keyval AND
ldap_entries.oc_map_id=? AND ldap_entries.parent=? AND NOT ('inetOrgPerson'
IS NULL)
==>backsql_dn2id(): dn='o=sql,c=ru'
id_query 'SELECT id,keyval,oc_map_id FROM ldap_entries WHERE dn=?'
==>backsql_dn2id(): upperdn='UR=C,LQS=O'
<==backsql_dn2id(): no match
backsql_oc_get_candidates(): could not retrieve base_dn id: no such entry
send_ldap_result: conn=3 op=1 p=3
send_ldap_result: err=32 matched="" text=""
send_ldap_response: msgid=2 tag=101 err=32
ber_flush: 14 bytes to sd 9
0000: 30 0c 02 01 02 65 07 0a 01 20 04 00 04 00 0....e... ....
ldap_write: want=14, written=14
0000: 30 0c 02 01 02 65 07 0a 01 20 04 00 04 00 0....e... ....
<==backsql_search()
Does anyone as any idea what I'm doing wrong?
Thanks in advance.
Regards
Massimo
P.S. Would you suggest to use back-perl to connect to Mysql?