}
static char escape[128] = {
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 1
};
#define NEEDFLTESCAPE(c) ((c) & 0x80 || escape[ (unsigned)(c) ])
Debug( LDAP_DEBUG_TRACE, "==>backsql_search(): "
"base=\"%s\", filter=\"%s\", scope=%d,",
op->o_req_ndn.bv_val,
- op->ors_filterstr.bv_val ? op->ors_filterstr.bv_val : "(no filter)",
+ op->ors_filterstr.bv_val,
op->ors_scope );
Debug( LDAP_DEBUG_TRACE, " deref=%d, attrsonly=%d, "
"attributes to load: %s\n",
SubstringsAssertion **s,
const char **text );
-static int filter_escape_value_x(
- struct berval *in,
- struct berval *out,
- void *ctx );
-
static void simple_vrFilter2bv(
Operation *op,
ValuesReturnFilter *f,
filter2bv_x( &op, f, fstr );
}
-static int
-filter_escape_value_x(
- struct berval *in,
- struct berval *out,
- void *ctx )
-{
- ber_len_t i;
- assert( in != NULL );
- assert( out != NULL );
-
- i = in->bv_len * 3 + 1;
- out->bv_val = ctx ? slap_sl_malloc( i, ctx ) : ch_malloc( i );
- out->bv_len = 0;
-
- for( i=0; i < in->bv_len ; i++ ) {
- if( FILTER_ESCAPE(in->bv_val[i]) ) {
- out->bv_val[out->bv_len++] = SLAP_ESCAPE_CHAR;
- out->bv_val[out->bv_len++] = SLAP_ESCAPE_HI( in->bv_val[i] );
- out->bv_val[out->bv_len++] = SLAP_ESCAPE_LO( in->bv_val[i] );
- } else {
- out->bv_val[out->bv_len++] = in->bv_val[i];
- }
- }
-
- out->bv_val[out->bv_len] = '\0';
- return LDAP_SUCCESS;
-}
-
-int
-filter_escape_value(
- struct berval *in,
- struct berval *out )
-{
- return filter_escape_value_x( in, out, NULL );
-}
-
static int
get_simple_vrFilter(
Operation *op,
LDAP_SLAPD_F (void) vrFilter2bv LDAP_P(( Operation *op, ValuesReturnFilter *f, struct berval *fstr ));
LDAP_SLAPD_F (int) filter_has_subordinates LDAP_P(( Filter *filter ));
-LDAP_SLAPD_F (int) filter_escape_value LDAP_P(( struct berval *in,
- struct berval *out ));
+#define filter_escape_value( in, out ) ldap_bv2escaped_filter_value_x( (in), (out), 0, NULL )
+#define filter_escape_value_x( in, out, ctx ) ldap_bv2escaped_filter_value_x( (in), (out), 0, ctx )
/*
* filterentry.c