1 /* compare.c - ldbm backend compare routine */
11 #include "back-ldbm.h"
12 #include "proto-back-ldbm.h"
23 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
29 /* get entry with reader lock */
30 if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
31 send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, "" );
33 if(matched == NULL) free(matched);
37 /* check for deleted */
38 if ( ! access_allowed( be, conn, op, e, ava->ava_type, &ava->ava_value,
39 op->o_dn, ACL_COMPARE ) ) {
40 send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS, "", "" );
45 if ( (a = attr_find( e->e_attrs, ava->ava_type )) == NULL ) {
46 send_ldap_result( conn, op, LDAP_NO_SUCH_ATTRIBUTE, "", "" );
51 if ( value_find( a->a_vals, &ava->ava_value, a->a_syntax, 1 ) == 0 )
52 send_ldap_result( conn, op, LDAP_COMPARE_TRUE, "", "" );
54 send_ldap_result( conn, op, LDAP_COMPARE_FALSE, "", "" );
59 cache_return_entry_r( &li->li_cache, e );