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

(ITS#5497) back-sql with base64 encoded attributes



Full_Name: Pavel Kislinger
Version: 2.4.8
OS: Freebsd 6.3 Stable
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (147.229.202.76)


I am using this packages:

openldap-server-2.4.8_1
openldap-client-2.4.8
mysql-client-5.0.51a
unixODBC-2.2.12_4
mysql-connector-odbc-unixodbc-mysql50-3.51.12_1

I have records with diacritics (czech language) like name or surname in SQL.
+-------+---------------+-----------+
| vutid | name          | surname   |
+-------+---------------+-----------+
|     1 | Pavel         | Kislinger |
|     2 | Michhě?čř?ýíé | ?abáček   |
+-------+---------------+-----------+


First record in SQL correspond to record in LDAP. Second record with diacritics
doesn't works.

# 1, users, test.vutbr.cz
dn: uid=1,ou=users,dc=test,dc=vutbr,dc=cz
objectClass: usi
cn: Pavel Kislinger
sn: Kislinger
givenName: Pavel
uid: 1

Solution of this problem is base64 encoding of attributes.
"cn" for second record "Michhě?čř?ýíé ?abáček" could be:
cn:: eHhNaWNoaOy56Pi+/e3pYWx4eCBLaXNsaW5nZXI=

I wrote MySQL function base64_encoding and adjusted table ldap_attr_mapping for
"cn":

insert into ldap_attr_mappings (<list of columns>) values
(114,3,'cn',"base64_encode(concat(users.name,'
',users.surname))",'users',NULL,NULL,NULL,3,0);

the result in ldap is:
cn: eHhNaWNoaOy56Pi+/e3pYWx4eCBLaXNsaW5nZXI=

This value is false recognized by ldap clients (outlook, thunderbird) as string
"eHhN..." instead of "Michh&#283;?&#269;&#345;?ýíé ?abá&#269;ek"




How can I mark "cn" attribute in SQL, that this attribute is encoded by base64?