global overlays need to set o_bd = frontendDB to return the error in case no database can be selected

This commit is contained in:
Pierangelo Masarati 2005-01-23 21:44:23 +00:00
parent 9effc2b8f0
commit b70abdcbce
7 changed files with 22 additions and 0 deletions

View File

@ -220,14 +220,18 @@ fe_op_add( Operation *op, SlapReply *rs )
if ( !rs->sr_ref ) rs->sr_ref = default_referral; if ( !rs->sr_ref ) rs->sr_ref = default_referral;
if ( rs->sr_ref ) { if ( rs->sr_ref ) {
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if ( rs->sr_ref != default_referral ) { if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref ); ber_bvarray_free( rs->sr_ref );
} }
} else { } else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" ); "no global superior knowledge" );
op->o_bd = NULL;
} }
goto done; goto done;
} }

View File

@ -464,7 +464,9 @@ fe_op_bind( Operation *op, SlapReply *rs )
/* don't return referral for bind requests */ /* don't return referral for bind requests */
/* noSuchObject is not allowed to be returned by bind */ /* noSuchObject is not allowed to be returned by bind */
rs->sr_err = LDAP_INVALID_CREDENTIALS; rs->sr_err = LDAP_INVALID_CREDENTIALS;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
goto cleanup; goto cleanup;
} }

View File

@ -208,7 +208,9 @@ fe_op_compare( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
if (!rs->sr_ref) rs->sr_ref = default_referral; if (!rs->sr_ref) rs->sr_ref = default_referral;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref ); if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
rs->sr_err = 0; rs->sr_err = 0;

View File

@ -124,12 +124,16 @@ fe_op_delete( Operation *op, SlapReply *rs )
if ( rs->sr_ref != NULL ) { if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref ); if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else { } else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" ); "no global superior knowledge" );
op->o_bd = NULL;
} }
goto cleanup; goto cleanup;
} }

View File

@ -316,12 +316,16 @@ fe_op_modify( Operation *op, SlapReply *rs )
if (rs->sr_ref != NULL ) { if (rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref ); if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else { } else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" ); "no global superior knowledge" );
op->o_bd = NULL;
} }
goto cleanup; goto cleanup;
} }

View File

@ -238,12 +238,16 @@ fe_op_modrdn( Operation *op, SlapReply *rs )
if ( rs->sr_ref != NULL ) { if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref ); if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else { } else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" ); "no global superior knowledge" );
op->o_bd = NULL;
} }
goto cleanup; goto cleanup;
} }

View File

@ -353,7 +353,9 @@ fe_op_search( Operation *op, SlapReply *rs )
if (!rs->sr_ref) rs->sr_ref = default_referral; if (!rs->sr_ref) rs->sr_ref = default_referral;
rs->sr_err = LDAP_REFERRAL; rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs ); send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) if (rs->sr_ref != default_referral)
ber_bvarray_free( rs->sr_ref ); ber_bvarray_free( rs->sr_ref );