]> git.sur5r.net Git - openldap/commitdiff
In backend_group, return LDAP_COMPARE_FALSE if attr exists but value is
authorHoward Chu <hyc@openldap.org>
Wed, 4 May 2005 06:28:27 +0000 (06:28 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 4 May 2005 06:28:27 +0000 (06:28 +0000)
not matched, instead of LDAP_NO_SUCH_ATTRIBUTE

servers/slapd/backend.c
servers/slapd/overlays/dyngroup.c

index 9a348f44bf00e220fd5c692b4f1afbb7d82b08b5..17a92e79aaa8f1b02c5bbc0a2a47c082104de706 100644 (file)
@@ -1281,7 +1281,7 @@ backend_group(
                                }
                                
                                if ( rc == 0 ) {
-                                       rc = 1;
+                                       rc = LDAP_COMPARE_FALSE;
                                        for ( i = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ ) {
                                                if ( ldap_url_parse( a->a_vals[i].bv_val, &ludp ) !=
                                                        LDAP_URL_SUCCESS )
@@ -1354,6 +1354,8 @@ loopit:
                                SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
                                SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
                                a->a_nvals, op_ndn, op->o_tmpmemctx );
+                               if ( rc == LDAP_NO_SUCH_ATTRIBUTE )
+                                       rc = LDAP_COMPARE_FALSE;
                        }
                } else {
                        rc = LDAP_NO_SUCH_ATTRIBUTE;
index d16f4df0e1b5912d9050b648758bc508a163b7f5..1bdd95e14e075c114a8e8bbcf74797ec7b35d7e0 100644 (file)
@@ -64,10 +64,11 @@ dyngroup_response( Operation *op, SlapReply *rs )
                                int cache = op->o_do_not_cache;
                                
                                op->o_do_not_cache = 1;
-                               if ( backend_group( op, NULL, &op->o_req_ndn,
-                                       &op->oq_compare.rs_ava->aa_value, NULL, ap->ap_uri ) == 0 )
-                                       rs->sr_err = LDAP_COMPARE_TRUE;
+                               rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
+                                       &op->oq_compare.rs_ava->aa_value, NULL, ap->ap_uri );
                                op->o_do_not_cache = cache;
+                               if ( rs->sr_err == LDAP_SUCCESS )
+                                       rs->sr_err = LDAP_COMPARE_TRUE;
                                break;
                        }
                }