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 );
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(): "
e->e_attrs = NULL;
e->e_private = NULL;
- /* if ( bsi->base_dn != NULL)??? */
-
e->e_id = eid->id;
if ( bsi->attrs != NULL ) {
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;
}
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;
}
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(): "
void
backsql_init_search(
backsql_srch_info *bsi,
- struct berval *nbase,
+ struct berval *base,
int scope,
int slimit,
int tlimit,
{
AttributeName *p;
- bsi->base_dn = nbase;
+ bsi->base_dn = base;
bsi->scope = scope;
bsi->slimit = slimit;
bsi->tlimit = tlimit;
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;