]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ad.c
Added proposed request parameters to Operation. #ifdef'd, not active.
[openldap] / servers / slapd / ad.c
index 9c13cc18684019f7380228689ae67881345f207f..cc3e7c1674a8fadcc73bf89e69618c8cf80ca66f 100644 (file)
@@ -191,8 +191,7 @@ int slap_bv2ad(
                        desc.ad_flags |= SLAP_DESC_BINARY;
                        continue;
 
-               } else if ( ad_find_option_definition( opt, optlen ) )
-               {
+               } else if ( ad_find_option_definition( opt, optlen ) ) {
                        int i;
 
                        if( opt[optlen-1] == '-' ) {
@@ -325,6 +324,7 @@ done:;
                }
 
                d2 = ch_malloc(sizeof(AttributeDescription) + dlen);
+               d2->ad_next = NULL;
                d2->ad_type = desc.ad_type;
                d2->ad_flags = desc.ad_flags;
                d2->ad_cname.bv_len = desc.ad_type->sat_cname.bv_len;
@@ -775,7 +775,7 @@ ad_define_option( const char *name, const char *fname, int lineno )
        } while ( name[++optlen] );
 
        options = ch_realloc( options,
-                             (option_count+1) * sizeof(Attr_option) );
+               (option_count+1) * sizeof(Attr_option) );
 
        if ( strcasecmp( name, "binary" ) == 0
             || ad_find_option_definition( name, optlen ) ) {
@@ -845,3 +845,25 @@ ad_find_option_definition( const char *opt, int optlen )
        }
        return NULL;
 }
+
+MatchingRule *ad_mr(
+       AttributeDescription *ad,
+       unsigned usage )
+{
+       switch( usage & SLAP_MR_TYPE_MASK ) {
+       case SLAP_MR_NONE:
+       case SLAP_MR_EQUALITY:
+               return ad->ad_type->sat_equality;
+               break;
+       case SLAP_MR_ORDERING:
+               return ad->ad_type->sat_ordering;
+               break;
+       case SLAP_MR_SUBSTR:
+               return ad->ad_type->sat_substr;
+               break;
+       case SLAP_MR_EXT:
+       default:
+               assert( 0 /* ad_mr: bad usage */);
+       }
+       return NULL;
+}