8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00

Fixed CORE-5822: Wrong error returned to client when WireCrypt=Disabled is used

This commit is contained in:
AlexPeshkoff 2018-05-10 15:58:45 +03:00
parent 3f417021da
commit 7de1b2ac9b

View File

@ -1779,13 +1779,8 @@ public:
static void setErrorStatus(IStatus* status)
{
Arg::Gds loginError(isc_login);
#ifndef DEV_BUILD
if (status->getErrors()[1] == isc_missing_data_structures)
#endif
{
loginError << Arg::StatusVector(status->getErrors());
}
status->setErrors(loginError.value());
if (!(status->getState() & IStatus::STATE_ERRORS))
status->setErrors(loginError.value());
}
static bool accept_connection(rem_port* port, P_CNCT* connect, PACKET* send)
@ -2004,12 +1999,27 @@ static bool accept_connection(rem_port* port, P_CNCT* connect, PACKET* send)
}
}
// Send off out gracious acceptance or flag rejection
if (!accepted)
{
HANDSHAKE_DEBUG(fprintf(stderr, "!accepted, sending reject\n"));
if (status.getState() & Firebird::IStatus::STATE_ERRORS)
port->send_response(send, 0, 0, &status, false);
{
if (status.getErrors()[1] != isc_missing_data_structures)
{
iscLogStatus("Authentication error", &status);
Arg::Gds loginError(isc_login_error);
#ifdef DEV_BUILD
loginError << Arg::StatusVector(&status);
#endif
LocalStatus tmp;
loginError.copyTo(&tmp);
port->send_response(send, 0, 0, &tmp, false);
}
else
port->send_response(send, 0, 0, &status, false);
}
else
port->send(send);
return false;