From 98a98342a13dab8c16da11f3b0c8154581d29d64 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Wed, 18 Jan 2017 14:42:49 -0800 Subject: [PATCH 1/2] Ticket 47973 - custom schema is registered in small caps after schema reload Description: The fix for ticket 47973 [1] brougt an side effect which lowers the case of the reloaded new schema. This patch fixes the issue by eliminating normalize_oc_nolock(). Note that the normalization is not needed since all the checks are done by strcasecmp. There is an exception. When trying to replace a schema with the same one having the different cases, exact string compare is called. [1] commit e0c78e1c1db351ea5cf835cdb55437b1ea26a3a6 --- ldap/servers/slapd/schema.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index c65cdba..392c01f 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -5377,10 +5377,17 @@ init_schema_dse_ext(char *schemadir, Slapi_Backend *be, if (rc && !(schema_flags & DSE_SCHEMA_NO_BACKEND)) { - /* make sure the schema is normalized */ if (schema_flags & DSE_SCHEMA_LOCKED) { - normalize_oc_nolock(); + /* + * Code path for schema reload. + * To fix the side effect which lowers the case of the + * reloaded new schema, eliminating normalize_oc_nolock(). + * Note that the normalization is not needed since all + * the checks are done by strcasecmp. + */ + ; } else { + /* make sure the schema is normalized */ normalize_oc(); } -- 2.9.3