/* str2filter.c - parse an rfc 1588 string filter */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
static int str2subvals( const char *val, Filter *f);
Filter *
-str2filter( const char *str )
+str2filter_x( Operation *op, const char *str )
{
int rc;
Filter *f = NULL;
- char berbuf[256];
- BerElement *ber = (BerElement *)berbuf;
- Connection conn;
+ BerElementBuffer berbuf;
+ BerElement *ber = (BerElement *)&berbuf;
const char *text = NULL;
#ifdef NEW_LOGGING
}
ber_init2( ber, NULL, LBER_USE_DER );
+ if ( op->o_tmpmemctx ) {
+ ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
+ }
rc = ldap_pvt_put_filter( ber, str );
if( rc < 0 ) {
ber_reset( ber, 1 );
- conn.c_connid = 0;
-
- rc = get_filter( &conn, ber, &f, &text );
+ rc = get_filter( op, ber, &f, &text );
done:
ber_free_buf( ber );
return f;
}
+
+Filter *
+str2filter( const char *str )
+{
+ Operation op = {0};
+
+ op.o_tmpmemctx = NULL;
+ op.o_tmpmfuncs = &ch_mfuncs;
+
+ return str2filter_x( &op, str );
+}