Commit 0c67c049 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

more cleanup; small improvements

parent 1f400adc
......@@ -29,6 +29,7 @@ backsql_bind( Operation *op, SlapReply *rs )
Entry *e, user_entry;
Attribute *a;
backsql_srch_info bsi;
AttributeName anlist[2];
int rc;
Debug( LDAP_DEBUG_TRACE, "==>backsql_bind()\n", 0, 0, 0 );
......@@ -74,8 +75,11 @@ backsql_bind( Operation *op, SlapReply *rs )
return 1;
}
anlist[0].an_name = password->ad_cname;
anlist[0].an_desc = password;
anlist[1].an_name.bv_val = NULL;
backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
-1, -1, -1, NULL, dbh, op, NULL );
-1, -1, -1, NULL, dbh, op, anlist );
e = backsql_id2entry( &bsi, &user_entry, &user_id );
if ( e == NULL ) {
Debug( LDAP_DEBUG_TRACE, "backsql_bind(): "
......
......@@ -370,8 +370,6 @@ backsql_id2entry( backsql_srch_info *bsi, Entry *e, backsql_entryID *eid )
e->e_attrs = NULL;
e->e_private = NULL;
/* if ( bsi->base_dn != NULL)??? */
e->e_id = eid->id;
if ( bsi->attrs != NULL ) {
......@@ -380,16 +378,7 @@ backsql_id2entry( backsql_srch_info *bsi, Entry *e, backsql_entryID *eid )
for ( i = 0; bsi->attrs[ i ].an_name.bv_val; i++ ) {
AttributeName *attr = &bsi->attrs[ i ];
if ( attr->an_desc == ad_oc
#if 0 /* FIXME: what is 0.10 ? */
|| !BACKSQL_NCMP( &attr->an_name, &bv_n_0_10 )
#endif
) {
#if 0
backsql_entry_addattr( bsi->e,
&bv_n_objectclass,
BACKSQL_OC_NAME( bsi->oc ) );
#endif
if ( attr->an_desc == ad_oc ) {
continue;
}
......@@ -438,10 +427,12 @@ backsql_id2entry( backsql_srch_info *bsi, Entry *e, backsql_entryID *eid )
return NULL;
}
if ( bsi->bsi_flags | BSQL_SF_ALL_OPER
if ( ( bsi->bsi_flags | BSQL_SF_ALL_OPER )
|| an_find( bsi->attrs, &AllOper ) ) {
if ( attr_merge_normalize_one( bsi->e, ad_soc, &soc,
bsi->op->o_tmpmemctx ) ) {
rc = attr_merge_normalize_one( bsi->e,
slap_schema.si_ad_structuralObjectClass,
&soc, bsi->op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
entry_free( e );
return NULL;
}
......
......@@ -57,7 +57,7 @@ backsql_compare( Operation *op, SlapReply *rs )
anlist[0].an_desc = op->oq_compare.rs_ava->aa_desc;
anlist[1].an_name.bv_val = NULL;
backsql_init_search( &bsi, &op->o_req_ndn, LDAP_SCOPE_BASE,
-1, -1, -1, NULL, dbh, op, anlist);
-1, -1, -1, NULL, dbh, op, anlist );
e = backsql_id2entry( &bsi, &user_entry, &user_id );
if ( e == NULL ) {
Debug( LDAP_DEBUG_TRACE, "backsql_compare(): "
......
......@@ -84,7 +84,7 @@ backsql_attrlist_add( backsql_srch_info *bsi, AttributeDescription *ad )
void
backsql_init_search(
backsql_srch_info *bsi,
struct berval *nbase,
struct berval *base,
int scope,
int slimit,
int tlimit,
......@@ -96,7 +96,7 @@ backsql_init_search(
{
AttributeName *p;
bsi->base_dn = nbase;
bsi->base_dn = base;
bsi->scope = scope;
bsi->slimit = slimit;
bsi->tlimit = tlimit;
......@@ -989,20 +989,6 @@ backsql_oc_get_candidates( void *v_oc, void *v_bsi )
int
backsql_search( Operation *op, SlapReply *rs )
/*
BackendDB *be,
Connection *conn,
Operation *op,
struct berval *base,
struct berval *nbase,
int scope,
int deref,
int slimit,
int tlimit,
Filter *filter,
struct berval *filterstr,
AttributeName *attrs,
int attrsonly ) */
{
backsql_info *bi = (backsql_info *)op->o_bd->be_private;
SQLHDBC dbh;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment