mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 07:39:35 -05:00
handle computed filters the best it can (ITS#4604)
This commit is contained in:
parent
7215346d1d
commit
fcab1dd1bc
1 changed files with 28 additions and 2 deletions
|
|
@ -654,12 +654,38 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
|
|||
|
||||
Debug( LDAP_DEBUG_TRACE, "==>backsql_process_filter()\n", 0, 0, 0 );
|
||||
if ( f->f_choice == SLAPD_FILTER_COMPUTED ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "backsql_process_filter(): "
|
||||
"invalid filter\n", 0, 0, 0 );
|
||||
struct berval flt;
|
||||
char *msg = NULL;
|
||||
|
||||
switch ( f->f_result ) {
|
||||
case LDAP_COMPARE_TRUE:
|
||||
BER_BVSTR( &flt, "10=10" );
|
||||
msg = "TRUE";
|
||||
break;
|
||||
|
||||
case LDAP_COMPARE_FALSE:
|
||||
BER_BVSTR( &flt, "11=0" );
|
||||
msg = "FALSE";
|
||||
break;
|
||||
|
||||
case SLAPD_COMPARE_UNDEFINED:
|
||||
BER_BVSTR( &flt, "12=0" );
|
||||
msg = "UNDEFINED";
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "backsql_process_filter(): "
|
||||
"filter computed (%s)\n", msg, 0, 0 );
|
||||
backsql_strfcat_x( &bsi->bsi_flt_where,
|
||||
bsi->bsi_op->o_tmpmemctx, "b", &flt );
|
||||
rc = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch( f->f_choice ) {
|
||||
case LDAP_FILTER_OR:
|
||||
rc = backsql_process_filter_list( bsi, f->f_or,
|
||||
|
|
|
|||
Loading…
Reference in a new issue