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

back-sql using varchar keyvals and ids



I have an interest in using openldap as an external authenticator for
our membership to connect to external services. Our main table has a
primary key of a varchar (10) and nothing unique in the table that is an
int. 

I would love to replace ldap_entries with a view, however, returning the
entries failed when I attempted it. 

I did a bit of experimentation with the dc=example,dc=com on a search:
ldapsearch -x -b dc=example,dc=com sn=Puzdoy

The ldap_entries keyval was changed from int to varchar 10 and persons
table id was changed to varchar 10.

Below is a table on some experiments

ldap_entries.keyval and persons.id	MySQL		SQL SERVER 2000
2						Ok		Ok
02						Ok		Fail
ABC						Fail		Fail
abc						Fail		Fail


Log:
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: Constructed query: SELECT
DISTINCT ldap_entries.id,persons.id,'inetOrgPerson' AS objectClass...
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: id: '1'
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: >>> dnPrettyNormal:
<cn=Torvlobnor Puzdoy,dc=example,dc=com>
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: <<< dnPrettyNormal:
<cn=Torvlobnor Puzdoy,dc=example,dc=com>, <cn=torvlobnor puzdoy,dc=examp
...
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: backsql_oc_get_candidates():
added entry id=3, keyval=2 dn="cn=Torvlobnor Puzdoy,dc=example, ...
Jul 31 10:15:41 jpotkanski-lx slapd[30011]:
<==backsql_oc_get_candidates(): 1
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: backsql_search(): loading
data for entry id=0, oc_id=0, keyval=0
Jul 31 10:15:41 jpotkanski-lx slapd[30011]: backsql_search(): loading
data for entry id=5, oc_id=2, keyval=1

On a failed one, backsql_oc_get_candidates(): 0

openldap 2.3.39, 4.fc8 , unixodbc 2.2.12, freetds .84, mysql-odbc
latest.

Before opening anything in ITS, I wondered if this is a bug, feature
request or maybe solved in 2.4?

Jason Potkanski
Information Technology Developer
CCIM Institute
430 N. Michigan Ave, Suite 800
Chicago, IL 60611-4092
jpotkanski@ccim.com
www.ccim.com
tel: 312.321.8559