Commit b70abdcb authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

global overlays need to set o_bd = frontendDB to return the error in case no...

global overlays need to set o_bd = frontendDB to return the error in case no database can be selected
parent 9effc2b8
......@@ -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_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
} else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
op->o_bd = NULL;
}
goto done;
}
......
......@@ -464,7 +464,9 @@ fe_op_bind( Operation *op, SlapReply *rs )
/* don't return referral for bind requests */
/* noSuchObject is not allowed to be returned by bind */
rs->sr_err = LDAP_INVALID_CREDENTIALS;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
goto cleanup;
}
......
......@@ -208,7 +208,9 @@ fe_op_compare( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_REFERRAL;
if (!rs->sr_ref) rs->sr_ref = default_referral;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
rs->sr_err = 0;
......
......@@ -124,12 +124,16 @@ fe_op_delete( Operation *op, SlapReply *rs )
if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
op->o_bd = NULL;
}
goto cleanup;
}
......
......@@ -316,12 +316,16 @@ fe_op_modify( Operation *op, SlapReply *rs )
if (rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
op->o_bd = NULL;
}
goto cleanup;
}
......
......@@ -238,12 +238,16 @@ fe_op_modrdn( Operation *op, SlapReply *rs )
if ( rs->sr_ref != NULL ) {
rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
op->o_bd = frontendDB;
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"no global superior knowledge" );
op->o_bd = NULL;
}
goto cleanup;
}
......
......@@ -353,7 +353,9 @@ fe_op_search( Operation *op, SlapReply *rs )
if (!rs->sr_ref) rs->sr_ref = default_referral;
rs->sr_err = LDAP_REFERRAL;
op->o_bd = frontendDB;
send_ldap_result( op, rs );
op->o_bd = NULL;
if (rs->sr_ref != default_referral)
ber_bvarray_free( rs->sr_ref );
......
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