From: Julio Sánchez Fernández Date: Sun, 15 Oct 2000 19:10:43 +0000 (+0000) Subject: Extend MRA. It now has a pointer to a MatchingRule, but a char X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1739 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5b52ae5109cd2a769c9469b6eebc2ef5b7108cd2;p=openldap Extend MRA. It now has a pointer to a MatchingRule, but a char pointer is kept for messages and to tell a filter without rule from one with an unknown rule. It matters. --- diff --git a/servers/slapd/mra.c b/servers/slapd/mra.c index 8469ae30cb..dc630f8c23 100644 --- a/servers/slapd/mra.c +++ b/servers/slapd/mra.c @@ -22,7 +22,7 @@ mra_free( ) { ad_free( mra->ma_desc, 1 ); - ch_free( (char *) mra->ma_rule ); + ch_free( mra->ma_rule_text ); ber_bvfree( mra->ma_value ); if ( freeit ) { ch_free( (char *) mra ); @@ -43,6 +43,7 @@ get_mra( ma = ch_malloc( sizeof( MatchingRuleAssertion ) ); ma->ma_rule = NULL; + ma->ma_rule_text = NULL; ma->ma_desc = NULL; ma->ma_dnattrs = 0; ma->ma_value = NULL; @@ -57,13 +58,14 @@ get_mra( } if ( tag == LDAP_FILTER_EXT_OID ) { - rc = ber_scanf( ber, "a", &ma->ma_rule ); + rc = ber_scanf( ber, "a", &ma->ma_rule_text ); if ( rc == LBER_ERROR ) { Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf for mr\n", 0, 0, 0 ); *text = "Error parsing matching rule in matching rule assertion"; mra_free( ma, 1 ); return SLAPD_DISCONNECT; } + ma->ma_rule = mr_find( ma->ma_rule_text ); rc = ber_scanf( ber, "t", &tag ); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index cde23a7d89..48d69172f1 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -478,7 +478,8 @@ typedef struct slap_ss_assertion { } SubstringsAssertion; typedef struct slap_mr_assertion { - char *ma_rule; /* optional */ + MatchingRule *ma_rule; /* optional */ + char *ma_rule_text; /* optional */ AttributeDescription *ma_desc; /* optional */ int ma_dnattrs; /* boolean */ struct berval *ma_value; /* required */ @@ -526,6 +527,7 @@ typedef struct slap_filter { #define f_sub_final f_un.f_un_ssa->sa_final #define f_mra f_un.f_un_mra #define f_mr_rule f_un.f_un_mra->ma_rule +#define f_mr_rule_text f_un.f_un_mra->ma_rule_text #define f_mr_desc f_un.f_un_mra->ma_desc #define f_mr_value f_un.f_un_mra->ma_value #define f_mr_dnattrs f_un.f_un_mra->ma_dnattrs