]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/matchedValues.c
sync with HEAD
[openldap] / servers / slapd / matchedValues.c
index ac953f111e33976a3ea062f1fa2ac1a34496e598..483a14956d225e1f988caa2bf4636202ff340a42 100644 (file)
@@ -23,7 +23,7 @@ static int test_mra_vrFilter(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        MatchingRuleAssertion *mra,
        char            ***e_flags
 );
@@ -33,7 +33,7 @@ test_substrings_vrFilter(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        ValuesReturnFilter *f,
        char            ***e_flags
 );
@@ -43,7 +43,7 @@ test_presence_vrFilter(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        AttributeDescription *desc,
        char            ***e_flags
 );
@@ -53,7 +53,7 @@ test_ava_vrFilter(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        AttributeAssertion *ava,
        int             type,
        char            ***e_flags
@@ -65,7 +65,7 @@ filter_matched_values(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        char            ***e_flags
 )
 {
@@ -73,8 +73,7 @@ filter_matched_values(
        int             rc = LDAP_SUCCESS;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "filter_matched_values: begin\n" ));
+       LDAP_LOG( FILTER, ENTRY, "filter_matched_values: begin\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "=> filter_matched_values\n", 0, 0, 0 );
 #endif
@@ -83,13 +82,12 @@ filter_matched_values(
                switch ( f->f_choice ) {
                case SLAPD_FILTER_COMPUTED:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( FILTER, DETAIL1, 
                                "test_vrFilter: COMPUTED %s (%d)\n",
                                f->f_result == LDAP_COMPARE_FALSE ? "false" :
                                f->f_result == LDAP_COMPARE_TRUE         ? "true"  :
                                f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
-                               "error",
-                               f->f_result ));
+                               "error", f->f_result, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     COMPUTED %s (%d)\n",
                                f->f_result == LDAP_COMPARE_FALSE ? "false" :
@@ -103,12 +101,11 @@ filter_matched_values(
 
                case LDAP_FILTER_EQUALITY:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: EQUALITY\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EQUALITY\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EQUALITY\n", 0, 0, 0 );
 #endif
-                       rc = test_ava_vrFilter( be, conn, op, e, f->f_ava,
+                       rc = test_ava_vrFilter( be, conn, op, a, f->f_ava,
                                LDAP_FILTER_EQUALITY, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -117,13 +114,12 @@ filter_matched_values(
 
                case LDAP_FILTER_SUBSTRINGS:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter  SUBSTRINGS\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter  SUBSTRINGS\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     SUBSTRINGS\n", 0, 0, 0 );
 #endif
 
-                       rc = test_substrings_vrFilter( be, conn, op, e,
+                       rc = test_substrings_vrFilter( be, conn, op, a,
                                f, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -132,12 +128,11 @@ filter_matched_values(
 
                case LDAP_FILTER_PRESENT:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: PRESENT\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter:      PRESENT\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     PRESENT\n", 0, 0, 0 );
 #endif
-                       rc = test_presence_vrFilter( be, conn, op, e,
+                       rc = test_presence_vrFilter( be, conn, op, a,
                                f->f_desc, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -145,7 +140,7 @@ filter_matched_values(
                        break;
 
                case LDAP_FILTER_GE:
-                       rc = test_ava_vrFilter( be, conn, op, e, f->f_ava,
+                       rc = test_ava_vrFilter( be, conn, op, a, f->f_ava,
                                LDAP_FILTER_GE, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -153,7 +148,7 @@ filter_matched_values(
                        break;
 
                case LDAP_FILTER_LE:
-                       rc = test_ava_vrFilter( be, conn, op, e, f->f_ava,
+                       rc = test_ava_vrFilter( be, conn, op, a, f->f_ava,
                                LDAP_FILTER_LE, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -162,12 +157,11 @@ filter_matched_values(
 
                case LDAP_FILTER_EXT:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1,
-                               "test_vrFilter: EXT\n" ));
+                       LDAP_LOG( FILTER, DETAIL1, "test_vrFilter:      EXT\n", 0, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EXT\n", 0, 0, 0 );
 #endif
-                       rc = test_mra_vrFilter( be, conn, op, e,
+                       rc = test_mra_vrFilter( be, conn, op, a,
                                f->f_mra, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -176,9 +170,8 @@ filter_matched_values(
 
                default:
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "filter", LDAP_LEVEL_INFO,
-                               "test_vrFilter:  unknown filter type %lu\n", 
-                               f->f_choice ));
+                       LDAP_LOG( FILTER, INFO, 
+                               "test_vrFilter:  unknown filter type %lu\n", f->f_choice, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "        unknown filter type %lu\n",
                                f->f_choice, 0, 0 );
@@ -188,8 +181,7 @@ filter_matched_values(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY,
-               "filter_matched_values:  return=%d\n", rc ));
+       LDAP_LOG( FILTER, ENTRY, "filter_matched_values:  return=%d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_FILTER, "<= filter_matched_values %d\n", rc, 0, 0 );
 #endif
@@ -198,25 +190,18 @@ filter_matched_values(
 
 static int
 test_ava_vrFilter(
-               Backend         *be,
+       Backend         *be,
        Connection      *conn,
-               Operation       *op,
-               Entry           *e,
+       Operation       *op,
+       Attribute       *a,
        AttributeAssertion *ava,
-               int             type,
-               char            ***e_flags
+       int             type,
+       char            ***e_flags
 )
 {
        int             i, j;
-       Attribute       *a;
-
-       if ( !access_allowed( be, conn, op, e,
-               ava->aa_desc, &ava->aa_value, ACL_SEARCH, NULL ) )
-       {
-               return LDAP_INSUFFICIENT_ACCESS;
-       }
 
-       for (a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+       for ( i=0; a != NULL; a = a->a_next, i++ ) {
 
                MatchingRule *mr;
                struct berval *bv;
@@ -287,22 +272,17 @@ test_ava_vrFilter(
 
 static int
 test_presence_vrFilter(
-               Backend         *be,
-               Connection      *conn,
-               Operation       *op,
-               Entry           *e,
-               AttributeDescription *desc,
-               char            ***e_flags
+       Backend         *be,
+       Connection      *conn,
+       Operation       *op,
+       Attribute       *a,
+       AttributeDescription *desc,
+       char            ***e_flags
 )
 {
        int i, j;
-       Attribute       *a;
 
-       if ( !access_allowed( be, conn, op, e, desc, NULL, ACL_SEARCH, NULL ) ) {
-               return LDAP_INSUFFICIENT_ACCESS;
-       }
-
-       for (a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+       for ( i=0; a != NULL; a = a->a_next, i++ ) {
                struct berval *bv;
 
                if ( !is_ad_subtype( a->a_desc, desc ) ) {
@@ -318,24 +298,17 @@ test_presence_vrFilter(
 
 static int
 test_substrings_vrFilter(
-               Backend         *be,
-               Connection      *conn,
-               Operation       *op,
-               Entry           *e,
-               ValuesReturnFilter *f,
-               char            ***e_flags
+       Backend         *be,
+       Connection      *conn,
+       Operation       *op,
+       Attribute       *a,
+       ValuesReturnFilter *f,
+       char            ***e_flags
 )
 {
        int i, j;
-       Attribute       *a;
-
-       if ( !access_allowed( be, conn, op, e,
-               f->f_sub_desc, NULL, ACL_SEARCH, NULL ) )
-       {
-               return LDAP_INSUFFICIENT_ACCESS;
-       }
 
-       for (a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+       for ( i=0; a != NULL; a = a->a_next, i++ ) {
                MatchingRule *mr = a->a_desc->ad_type->sat_substr;
                struct berval *bv;
 
@@ -373,21 +346,14 @@ static int test_mra_vrFilter(
        Backend         *be,
        Connection      *conn,
        Operation       *op,
-       Entry           *e,
+       Attribute       *a,
        MatchingRuleAssertion *mra,
        char            ***e_flags
 )
 {
        int i, j;
-       Attribute       *a;
-
-       if( !access_allowed( be, conn, op, e,
-               mra->ma_desc, &mra->ma_value, ACL_SEARCH, NULL ) )
-       {
-               return LDAP_INSUFFICIENT_ACCESS;
-       }
 
-       for (a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+       for ( i=0; a != NULL; a = a->a_next, i++ ) {
                struct berval *bv;
        
                if ( !is_ad_subtype( a->a_desc, mra->ma_desc ) ) {