]> git.sur5r.net Git - openldap/commitdiff
Extend MRA. It now has a pointer to a MatchingRule, but a char
authorJulio Sánchez Fernández <jsanchez@openldap.org>
Sun, 15 Oct 2000 19:10:43 +0000 (19:10 +0000)
committerJulio Sánchez Fernández <jsanchez@openldap.org>
Sun, 15 Oct 2000 19:10:43 +0000 (19:10 +0000)
pointer is kept for messages and to tell a filter without rule
from one with an unknown rule.  It matters.

servers/slapd/mra.c
servers/slapd/slap.h

index 8469ae30cba0b44ea7fadfa54a002c92bd37303f..dc630f8c23eb620e4843e6f63b3d4c70961d6ea7 100644 (file)
@@ -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 );
 
index cde23a7d893a923962413268d2a1a80d4e8fdc25..48d69172f1326a7db33cc622817f5f2d1a70d067 100644 (file)
@@ -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