]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/mr.c
Commit of the Proxy Cache contribution (ITS#2062)
[openldap] / servers / slapd / mr.c
index 3f6e9ea4c0c87199002c2dbff46317707b9273e7..0a7fe04f4a3e57ffbf23d2b6632172f6ea47ae03 100644 (file)
@@ -180,13 +180,11 @@ mr_add(
        smr->smr_compat_syntaxes = compat_syn;
        smr->smr_normalize = def->mrd_normalize;
        smr->smr_match = def->mrd_match;
-#ifdef SLAP_NVALUES
-       /* disable indexing for now */
-#else
+#ifndef SLAP_NVALUES
        smr->smr_convert = def->mrd_convert;
+#endif
        smr->smr_indexer = def->mrd_indexer;
        smr->smr_filter = def->mrd_filter;
-#endif
        smr->smr_associated = amr;
 
        if ( smr->smr_syntax_oid ) {
@@ -442,9 +440,11 @@ int mr_usable_with_at(
 
 int mr_schema_info( Entry *e )
 {
-       MatchingRule *mr;
-
        AttributeDescription *ad_matchingRules = slap_schema.si_ad_matchingRules;
+       MatchingRule *mr;
+#ifdef SLAP_NVALUES
+       struct berval nval;
+#endif
 
        LDAP_SLIST_FOREACH(mr, &mr_list, smr_next ) {
                if ( mr->smr_usage & SLAP_MR_HIDE ) {
@@ -467,7 +467,9 @@ int mr_schema_info( Entry *e )
                        mr->smr_str.bv_len, mr->smr_str.bv_val, 0 );
 #endif
 #ifdef SLAP_NVALUES
-               if( attr_merge_one( e, ad_matchingRules, &mr->smr_str, NULL /* FIXME */ ) )
+               nval.bv_val = mr->smr_oid;
+               nval.bv_len = strlen(mr->smr_oid);
+               if( attr_merge_one( e, ad_matchingRules, &mr->smr_str, &nval ) )
 #else
                if( attr_merge_one( e, ad_matchingRules, &mr->smr_str ) )
 #endif
@@ -480,10 +482,12 @@ int mr_schema_info( Entry *e )
 
 int mru_schema_info( Entry *e )
 {
-       MatchingRuleUse *mru;
-
        AttributeDescription *ad_matchingRuleUse 
                = slap_schema.si_ad_matchingRuleUse;
+       MatchingRuleUse *mru;
+#ifdef SLAP_NVALUES
+       struct berval nval;
+#endif
 
        LDAP_SLIST_FOREACH( mru, &mru_list, smru_next ) {
 
@@ -501,7 +505,9 @@ int mru_schema_info( Entry *e )
                        mru->smru_str.bv_len, mru->smru_str.bv_val, 0 );
 #endif
 #ifdef SLAP_NVALUES
-               if( attr_merge_one( e, ad_matchingRuleUse, &mru->smru_str, NULL /* FIXME */ ) )
+               nval.bv_val = mru->smru_oid;
+               nval.bv_len = strlen(mru->smru_oid);
+               if( attr_merge_one( e, ad_matchingRuleUse, &mru->smru_str, &nval ) )
 #else
                if( attr_merge_one( e, ad_matchingRuleUse, &mru->smru_str ) )
 #endif