+ rc = slap_bv2ad( &desc, &ava.aa_desc, &text );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ goto cleanup;
+ }
+
+ rc = value_validate_normalize( ava.aa_desc, SLAP_MR_EQUALITY,
+ &value, &ava.aa_value, &text );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ goto cleanup;
+ }
+
+ if( strcasecmp( ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ARGS,
+ "do_compare: dn (%s) attr(%s) value (%s)\n",
+ pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
+#else
+ Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
+ pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
+#endif
+
+ Statslog( LDAP_DEBUG_STATS,
+ "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
+ op->o_connid, op->o_opid, pdn.bv_val,
+ ava.aa_desc->ad_cname.bv_val, 0 );
+
+ rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ;
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ goto cleanup;
+ }
+
+ rc = root_dse_info( conn, &entry, &text );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ goto cleanup;
+ }
+
+ fentry = entry;
+
+ } else if ( bvmatch( &ndn, &global_schemandn ) ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ARGS,
+ "do_compare: dn (%s) attr(%s) value (%s)\n",
+ pdn.bv_val, ava.aa_desc->ad_cname.bv_val,
+ ava.aa_value.bv_val );
+#else
+ Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
+ pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
+#endif
+
+ Statslog( LDAP_DEBUG_STATS,
+ "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
+ op->o_connid, op->o_opid, pdn.bv_val,
+ ava.aa_desc->ad_cname.bv_val, 0 );
+
+ rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ;
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ rc = 0;
+ goto cleanup;
+ }
+
+ rc = schema_info( &entry, &text );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+ rc = 0;
+ goto cleanup;
+ }
+ fentry = entry;
+ }
+
+ if( entry ) {
+ rc = compare_entry( conn, op, entry, &ava );
+ if( fentry) entry_free( fentry );
+
+ send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
+
+ if( rc == LDAP_COMPARE_TRUE || rc == LDAP_COMPARE_FALSE ) {
+ rc = 0;
+ }
+
+ goto cleanup;
+ }
+
+ manageDSAit = get_manageDSAit( op );
+