]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/mr.c
ITS#1716 is_entry_subentr/ies/y/
[openldap] / servers / slapd / mr.c
index 4603128422b7d06103ce3d29a6de412dd49acf2f..e1af29d0c88fbee2205347a255571b63422f67a5 100644 (file)
@@ -1,7 +1,7 @@
 /* mr.c - routines to manage matching rule definitions */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -272,32 +272,40 @@ register_matching_rule(
 
 int mr_schema_info( Entry *e )
 {
-       struct berval   val;
-       struct berval   *vals[2];
+       struct berval   vals[2];
        MatchingRule    *mr;
 
        AttributeDescription *ad_matchingRules = slap_schema.si_ad_matchingRules;
 
-       vals[0] = &val;
-       vals[1] = NULL;
+       vals[1].bv_val = NULL;
 
        for ( mr = mr_list; mr; mr = mr->smr_next ) {
+               if ( mr->smr_usage & SLAP_MR_HIDE ) {
+                       /* skip hidden rules */
+                       continue;
+               }
+
                if ( ! mr->smr_match ) {
                        /* skip rules without matching functions */
                        continue;
                }
 
-               if ( ldap_matchingrule2bv( &mr->smr_mrule, &val ) == NULL ) {
+               if ( ldap_matchingrule2bv( &mr->smr_mrule, vals ) == NULL ) {
                        return -1;
                }
 #if 0
                Debug( LDAP_DEBUG_TRACE, "Merging mr [%ld] %s\n",
-              (long) val.bv_len, val.bv_val, 0 );
+              (long) vals[0].bv_len, vals[0].bv_val, 0 );
 #endif
                attr_merge( e, ad_matchingRules, vals );
-               ldap_memfree( val.bv_val );
+               ldap_memfree( vals[0].bv_val );
        }
        return 0;
 }
 
+int mru_schema_info( Entry *e )
+{
+       return 0;
+}
+
 #endif