Removed change_user_auth_switch flag

pull/5285/head
Rahim Kanji 3 months ago
parent ef872c7f48
commit 556b1023c4

@ -528,16 +528,6 @@ public:
//bool started_sending_data_to_client; // this status variable tracks if some result set was sent to the client, or if proxysql is still buffering everything
bool use_ssl;
#endif // 0
/**
* @brief This status variable tracks whether the session is performing an
* 'Auth Switch' due to a 'COM_CHANGE_USER' packet.
* @details It becomes 'true' when the packet is detected and processed by:
* - 'MySQL_Protocol::process_pkt_COM_CHANGE_USER'
* It's reset before sending the final response for 'Auth Switch' to the client by:
* - 'PgSQL_Session::handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE'
* This flag was introduced for issue #3504.
*/
bool change_user_auth_switch;
// MySQL_STMTs_meta* sess_STMTs_meta;
// StmtLongDataHandler* SLDH;

@ -269,7 +269,6 @@ PgSQL_Session::PgSQL_Session() {
active_transactions = 0;
use_ssl = false;
change_user_auth_switch = false;
match_regexes = NULL;
copy_cmd_matcher = NULL;
@ -3475,20 +3474,7 @@ void PgSQL_Session::handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(
}
free(addr);
free(client_addr);
}
else {
uint8_t _pid = 2;
if (client_myds->switching_auth_stage) _pid += 2;
if (is_encrypted) _pid++;
// If this condition is met, it means that the
// 'STATE_SERVER_HANDSHAKE' being performed isn't from the start of a
// connection, but as a consequence of a 'COM_USER_CHANGE' which
// requires an 'Auth Switch'. Thus, we impose a 'pid' of '3' for the
// response 'OK' packet. See #3504 for more context.
if (change_user_auth_switch) {
_pid = 3;
change_user_auth_switch = 0;
}
} else {
if (use_ssl == true && is_encrypted == false) {
*wrong_pass = true;
GloPgSQL_Logger->log_audit_entry(PGSQL_LOG_EVENT_TYPE::AUTH_ERR, this, NULL);
@ -3503,8 +3489,7 @@ void PgSQL_Session::handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(
__sync_add_and_fetch(&PgHGM->status.client_connections_aborted, 1);
free(_s);
__sync_fetch_and_add(&PgHGM->status.access_denied_wrong_password, 1);
}
else {
} else {
// we are good!
//client_myds->myprot.generate_pkt_OK(true,NULL,NULL, (is_encrypted ? 3 : 2), 0,0,0,0,NULL,false);
proxy_debug(PROXY_DEBUG_MYSQL_CONNECTION, 8, "Session=%p , DS=%p . STATE_CLIENT_AUTH_OK\n", this, client_myds);

Loading…
Cancel
Save