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
----- "Jason Potkanski" JPotkanski@cciminstitute.com wrote:
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.
You can modify back-sql.h, defining BACKSQL_ARBITRARY_KEY and recompiling, to allow strings to be used as keys. Not extensively tested, but should work.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
----- Pierangelo Masarati ando@sys-net.it wrote:
You can modify back-sql.h, defining BACKSQL_ARBITRARY_KEY and recompiling, to allow strings to be >used as keys. Not extensively tested, but should work.
Altered the Fedora SRPM to define BACKSQL_ARBITRARY_KEY, rebuilt the RPMs.
Works as expected with either MS SQL Server or MySQL backends. I was able to successfully replace ldap_entries with a view and use baseObject in slapd.conf
Why isn't this #define on by default? Can this be always on or if not moved to a configuration variable in slapd.conf to turn it on?
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
----- "Jason Potkanski" JPotkanski@cciminstitute.com wrote:
----- Pierangelo Masarati ando@sys-net.it wrote:
You can modify back-sql.h, defining BACKSQL_ARBITRARY_KEY and
recompiling, to allow strings to be >used as keys. Not extensively tested, but should work.
Altered the Fedora SRPM to define BACKSQL_ARBITRARY_KEY, rebuilt the RPMs.
Works as expected with either MS SQL Server or MySQL backends. I was able to successfully replace ldap_entries with a view and use baseObject in slapd.conf
Why isn't this #define on by default? Can this be always on or if not moved to a configuration variable in slapd.conf to turn it on?
Because it was a hack, initially not meant for release; because allowing the two functionalities run-time is sort of a mess; because using integers is way more efficient. Probably, it's something to consider anyway (or, at least, to document).
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
--On Friday, August 01, 2008 4:05 PM -0500 "Potkanski, Jason" JPotkanski@cciminstitute.com wrote:
----- Pierangelo Masarati ando@sys-net.it wrote:
You can modify back-sql.h, defining BACKSQL_ARBITRARY_KEY and recompiling, to allow strings to be >used as keys. Not extensively tested, but should work.
Altered the Fedora SRPM to define BACKSQL_ARBITRARY_KEY, rebuilt the RPMs.
Works as expected with either MS SQL Server or MySQL backends. I was able to successfully replace ldap_entries with a view and use baseObject in slapd.conf
Why isn't this #define on by default? Can this be always on or if not moved to a configuration variable in slapd.conf to turn it on?
Can't you just set it in CFLAGS when you compile?
--Quanah
--
Quanah Gibson-Mount Principal Software Engineer Zimbra, Inc -------------------- Zimbra :: the leader in open source messaging and collaboration
Can't you just set it in CFLAGS when you compile?
Actually, in CPPFLAGS. But I don't think so, as there's an explicit #undef FLAG in back-sql.h (unless -DFLAG overrides it, dunno). That's what I mean by "exposing" it: allow it to be set without hacking the code.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
openldap-software@openldap.org