mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Handle error response during caching_sha2_password auth
In particular, this fixes handling of expired passwords.
This commit is contained in:
parent
e7e1254f3e
commit
813d4a00b4
3 changed files with 24 additions and 6 deletions
|
@ -1073,6 +1073,13 @@ mysqlnd_caching_sha2_handle_server_response(struct st_mysqlnd_authentication_plu
|
|||
}
|
||||
|
||||
switch (result_packet.response_code) {
|
||||
case 0xFF:
|
||||
if (result_packet.sqlstate[0]) {
|
||||
strlcpy(conn->error_info->sqlstate, result_packet.sqlstate, sizeof(conn->error_info->sqlstate));
|
||||
DBG_ERR_FMT("ERROR:%u [SQLSTATE:%s] %s", result_packet.error_no, result_packet.sqlstate, result_packet.error);
|
||||
}
|
||||
SET_CLIENT_ERROR(conn->error_info, result_packet.error_no, UNKNOWN_SQLSTATE, result_packet.error);
|
||||
DBG_RETURN(FAIL);
|
||||
case 0xFE:
|
||||
DBG_INF("auth switch response");
|
||||
*new_auth_protocol = result_packet.new_auth_protocol;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue