return 1;
}
- backsql_init_search( &bsi, bi, &op->o_req_ndn, LDAP_SCOPE_BASE,
- -1, -1, -1, NULL, dbh, op->o_bd, op->o_conn, op, NULL );
+ backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
+ -1, -1, -1, NULL, dbh, op, NULL );
e = backsql_id2entry( &bsi, &user_entry, &user_id );
if ( e == NULL ) {
Debug( LDAP_DEBUG_TRACE, "backsql_bind(): "
bv.bv_len = strlen( row.cols[ i ] );
#endif
backsql_entry_addattr( bsi->e,
- &row.col_names[ i ], &bv );
+ &row.col_names[ i ], &bv,
+ bsi->op->o_tmpmemctx );
#ifdef BACKSQL_TRACE
Debug( LDAP_DEBUG_TRACE, "prec=%d\n",
Debug( LDAP_DEBUG_TRACE, "==>backsql_id2entry()\n", 0, 0, 0 );
- rc = dnPrettyNormal( NULL, &eid->dn, &e->e_name, &e->e_nname );
+ rc = dnPrettyNormal( NULL, &eid->dn, &e->e_name, &e->e_nname,
+ bsi->op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
return NULL;
}
bsi, 0, AVL_INORDER );
}
- if ( attr_mergeit_one( bsi->e, ad_oc, &bsi->oc->oc->soc_cname ) ) {
+ if ( attr_merge_normalize_one( bsi->e, ad_oc, &bsi->oc->oc->soc_cname,
+ bsi->op->o_tmpmemctx ) ) {
entry_free( e );
return NULL;
}
if ( bsi->bsi_flags | BSQL_SF_ALL_OPER
|| an_find( bsi->attrs, &AllOper ) ) {
- if ( attr_mergeit_one( bsi->e, ad_soc, &soc ) ) {
+ if ( attr_merge_normalize_one( bsi->e, ad_soc, &soc,
+ bsi->op->o_tmpmemctx ) ) {
entry_free( e );
return NULL;
}
goto modrdn_return;
}
- build_new_dn( &new_dn, new_pdn, &op->oq_modrdn.rs_newrdn );
- if ( dnNormalize2( NULL, &new_dn, &new_ndn ) != LDAP_SUCCESS ) {
+ build_new_dn( &new_dn, new_pdn, &op->oq_modrdn.rs_newrdn );
+ rs->sr_err = dnNormalize2( NULL, &new_dn, &new_ndn, op->o_tmpmemctx );
+ if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_modrdn(): "
"new dn is invalid ('%s') - aborting\n",
new_dn.bv_val, 0, 0 );
- rs->sr_err = LDAP_INVALID_DN_SYNTAX;
- rs->sr_text = "new DN is invalid";
+ rs->sr_text = "unable to build new DN";
send_ldap_result( op, rs );
goto modrdn_return;
}
anlist[0].an_name = op->oq_compare.rs_ava->aa_desc->ad_cname;
anlist[0].an_desc = op->oq_compare.rs_ava->aa_desc;
anlist[1].an_name.bv_val = NULL;
- backsql_init_search( &bsi, bi, &op->o_req_ndn, LDAP_SCOPE_BASE,
- -1, -1, -1, NULL, dbh, op->o_bd, op->o_conn, op,
- anlist);
+ backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
+ -1, -1, -1, NULL, dbh, op, anlist);
e = backsql_id2entry( &bsi, &user_entry, &user_id );
if ( e == NULL ) {
Debug( LDAP_DEBUG_TRACE, "backsql_compare(): "
if ( value_find_ex( op->oq_compare.rs_ava->aa_desc,
SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
- a->a_nvals, &op->oq_compare.rs_ava->aa_value ) == 0 )
+ a->a_nvals,
+ &op->oq_compare.rs_ava->aa_value,
+ op->o_tmpmemctx ) == 0 )
{
rs->sr_err = LDAP_COMPARE_TRUE;
break;
void
backsql_init_search(
backsql_srch_info *bsi,
- backsql_info *bi,
struct berval *nbase,
int scope,
int slimit,
time_t stoptime,
Filter *filter,
SQLHDBC dbh,
- BackendDB *be,
- Connection *conn,
Operation *op,
AttributeName *attrs )
{
bsi->tlimit = tlimit;
bsi->filter = filter;
bsi->dbh = dbh;
- bsi->be = be;
- bsi->conn = conn;
bsi->op = op;
bsi->bsi_flags = 0;
bsi->id_list = NULL;
bsi->n_candidates = 0;
bsi->stoptime = stoptime;
- bsi->bi = bi;
bsi->sel.bv_val = NULL;
bsi->sel.bv_len = 0;
bsi->sel_len = 0;
static int
backsql_srch_query( backsql_srch_info *bsi, struct berval *query )
{
- backsql_info *bi = (backsql_info *)bsi->be->be_private;
+ backsql_info *bi = (backsql_info *)bsi->op->o_bd->be_private;
ber_len_t q_len = 0;
int rc;
/* compute it anyway; root does not use it */
stoptime = op->o_time + op->oq_search.rs_tlimit;
- backsql_init_search( &srch_info, bi, &op->o_req_dn,
+ backsql_init_search( &srch_info, &op->o_req_dn,
op->oq_search.rs_scope,
op->oq_search.rs_slimit, op->oq_search.rs_tlimit,
stoptime, op->oq_search.rs_filter,
- dbh, op->o_bd, op->o_conn, op,
- op->oq_search.rs_attrs );
+ dbh, op, op->oq_search.rs_attrs );
/*
* for each objectclass we try to construct query which gets IDs
backsql_entry_addattr(
Entry *e,
struct berval *at_name,
- struct berval *at_val )
+ struct berval *at_val,
+ void *memctx )
{
AttributeDescription *ad;
int rc;
return 0;
}
- rc = attr_mergeit_one( e, ad, at_val );
+ rc = attr_merge_normalize_one( e, ad, at_val, memctx );
if ( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE, "backsql_entry_addattr(): "
const char *fmt, ... );
int backsql_entry_addattr( Entry *e, struct berval *at_name,
- struct berval *at_val );
+ struct berval *at_val, void *memctx );
typedef struct backsql_srch_info {
struct berval *base_dn;
ber_len_t sel_len, from_len, jwhere_len, fwhere_len;
SQLHDBC dbh;
int status;
- Backend *be;
- Connection *conn;
Operation *op;
AttributeName *attrs;
int bsi_flags;
int use_reverse_dn;
} backsql_srch_info;
-void backsql_init_search( backsql_srch_info *bsi, backsql_info *bi,
+void backsql_init_search( backsql_srch_info *bsi,
struct berval *nbase, int scope, int slimit, int tlimit,
time_t stoptime, Filter *filter, SQLHDBC dbh,
- BackendDB *be, Connection *conn, Operation *op,
- AttributeName *attrs );
+ Operation *op, AttributeName *attrs );
Entry *backsql_id2entry( backsql_srch_info *bsi, Entry *e,
backsql_entryID *id );