diff options
author | Pete Rowley <prowley@redhat.com> | 2006-01-06 21:49:53 +0000 |
---|---|---|
committer | Pete Rowley <prowley@redhat.com> | 2006-01-06 21:49:53 +0000 |
commit | ddbfc31998f37401fc3c5998c6b8a2001f06c5bc (patch) | |
tree | a3c844b569d4d9ffb368c9404dc422353e7eeddf | |
parent | bd9502521f28e42350fb8c0706fbe4235f885582 (diff) | |
download | ds-ddbfc31998f37401fc3c5998c6b8a2001f06c5bc.tar.gz ds-ddbfc31998f37401fc3c5998c6b8a2001f06c5bc.tar.xz ds-ddbfc31998f37401fc3c5998c6b8a2001f06c5bc.zip |
173375: Problems with schema matching rules
-rw-r--r-- | ldap/servers/plugins/collation/collate.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/ldap/servers/plugins/collation/collate.c b/ldap/servers/plugins/collation/collate.c index fb647368..25da89f3 100644 --- a/ldap/servers/plugins/collation/collate.c +++ b/ldap/servers/plugins/collation/collate.c @@ -132,19 +132,34 @@ collation_config (size_t cargc, char** cargv, strcpy(nameOrder,"caseExactOrderingMatch"); strcpy(nameSubstring,"caseExactSubstringMatch"); } - + + /* PAR: this looks broken + the "extra" text based oids that are actually used + to form the name and description are always derived + from the language and country fields so there should + be no need to have two separate code paths to + set the name and description fields of the schema + as language is always available, and if country is + not, it is not in the name anyway. + + Is it safe to assume all matching rules will follow + this convention? The answer, or lack of it, probably + explains the reasoning for doing things the way they + are currently. + */ + if(cargc > 7) { - strcpy(nameOrder,"-"); + PL_strcatn(nameOrder,sizeof(nameOrder),"-"); PL_strcatn(nameOrder,sizeof(nameOrder),cargv[7]); - strcpy(nameSubstring,"-"); + PL_strcatn(nameSubstring,sizeof(nameSubstring),"-"); PL_strcatn(nameSubstring,sizeof(nameSubstring),cargv[7]); slapi_matchingrule_set(mrentry,SLAPI_MATCHINGRULE_NAME, (void *)slapi_ch_strdup(nameOrder)); } - else { + else { if(0 != cargv[1][0]) { - strcpy(nameOrder,"-"); - strcpy(nameSubstring,"-"); + PL_strcatn(nameOrder,sizeof(nameOrder),"-"); + PL_strcatn(nameSubstring,sizeof(nameSubstring),"-"); } else { nameOrder[0] = 0; nameSubstring[0] = 0; |