From: Howard Chu Date: Wed, 4 May 2005 06:28:27 +0000 (+0000) Subject: In backend_group, return LDAP_COMPARE_FALSE if attr exists but value is X-Git-Tag: OPENLDAP_AC_BP~751 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a2d53f3960b0fb06bb534f8b002abb985e7d1f2;p=openldap In backend_group, return LDAP_COMPARE_FALSE if attr exists but value is not matched, instead of LDAP_NO_SUCH_ATTRIBUTE --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 9a348f44bf..17a92e79aa 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -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; diff --git a/servers/slapd/overlays/dyngroup.c b/servers/slapd/overlays/dyngroup.c index d16f4df0e1..1bdd95e14e 100644 --- a/servers/slapd/overlays/dyngroup.c +++ b/servers/slapd/overlays/dyngroup.c @@ -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; } }