summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-10-05 09:31:15 -0700
committerRich Megginson <rmeggins@redhat.com>2010-10-14 17:24:04 -0600
commit009b9dd1277d2522778d1da3931e8aded01321cc (patch)
treee53364843e7238cca70dabb6447ae88f3a06d36a
parent53f788bbae3f6c0a27466764c50b1858a69d1220 (diff)
downloadds-009b9dd1277d2522778d1da3931e8aded01321cc.tar.gz
ds-009b9dd1277d2522778d1da3931e8aded01321cc.tar.xz
ds-009b9dd1277d2522778d1da3931e8aded01321cc.zip
Bug 639289 - Adding a new CN entry with UpperCase UTF-8 Character
https://bugzilla.redhat.com/show_bug.cgi?id=639289 Description: There was a bug in the utf8 uppe2Lower table: Character İ (LATIN CAPITAL LETTER I WITH DOT ABOVE) did not map to the corresponding LATIN SMALL LETTER DOTLESS I (2 bytes) but to ascii 'i' (1 byte). The shortened DN tailed with a garbage character and the entry was treated as an orphan entry which does not belong to any suffix. This patch fixes the mapping table mismatch as well as adds a code to dn_ignore_case_to_end to force to NULL terminate the converted string. Branch: 389-ds-base-1.2.6 (cherry picked from commit 76c33394c21a64a7c20047f72196b31dfdf233f0)
-rw-r--r--ldap/servers/slapd/dn.c3
-rw-r--r--ldap/servers/slapd/utf8compare.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index e50ec768..172a8296 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -1240,6 +1240,9 @@ dn_ignore_case_to_end( char *dn, char *end )
s += ssz, d += dsz) {
slapi_utf8ToLower( s, d, &ssz, &dsz );
}
+ if (d) {
+ *d = '\0'; /* utf8ToLower result may be shorter than the original */
+ }
return( dn );
}
diff --git a/ldap/servers/slapd/utf8compare.c b/ldap/servers/slapd/utf8compare.c
index 5d28b8c3..12cdf220 100644
--- a/ldap/servers/slapd/utf8compare.c
+++ b/ldap/servers/slapd/utf8compare.c
@@ -133,7 +133,7 @@ UpperLowerTbl_t Upper2LowerTbl21[] = {
{"\304\252", "\304\253", 2},
{"\304\254", "\304\255", 2},
{"\304\256", "\304\257", 2},
- {"\304\260", "\151", 1},
+ {"\304\260", "\304\261", 2},
{"\304\262", "\304\263", 2},
{"\304\264", "\304\265", 2},
{"\304\266", "\304\267", 2},