Entry *e;
/* don't return more entries than requested by the client */
- if ( si->slimit && rs->sr_nentries >= si->slimit ) {
+ if ( si->slimit > 0 && rs->sr_nentries >= si->slimit ) {
si->slimit_exceeded = 1;
}
goto over;
}
+ /* check for malformed entries: attrs with no values */
+ {
+ Attribute *a = rs->sr_entry->e_attrs;
+ for (; a; a=a->a_next) {
+ if ( !a->a_numvals ) {
+ Debug( pcache_debug, "%s: query not cacheable because of attrs without values in DN \"%s\" (%s)\n",
+ op->o_log_prefix, rs->sr_entry->e_name.bv_val,
+ a->a_desc->ad_cname.bv_val );
+ goto over;
+ }
+ }
+ }
+
if ( si->count < si->max ) {
si->count++;
e = entry_dup( rs->sr_entry );
(*new_attrs)[i].an_desc = attrs->attrs[i].an_desc;
}
BER_BVZERO( &(*new_attrs)[i].an_name );
- alluser = an_find(*new_attrs, &AllUser);
- allop = an_find(*new_attrs, &AllOper);
+ alluser = an_find( *new_attrs, slap_bv_all_user_attrs );
+ allop = an_find( *new_attrs, slap_bv_all_operational_attrs );
j = i;
for ( i=0; i<fattr_cnt; i++ ) {
si->slimit = 0;
si->slimit_exceeded = 0;
si->caching_reason = PC_IGNORE;
- if ( op->ors_slimit && op->ors_slimit < cm->num_entries_limit ) {
+ if ( op->ors_slimit > 0 && op->ors_slimit < cm->num_entries_limit ) {
si->slimit = op->ors_slimit;
op->ors_slimit = cm->num_entries_limit;
}