Skip to content

Commit 2a722fc

Browse files
committed
MDEV-37554 MariaDB auth protocol differs from MySQL
fix auth protocol to match MySQL changes
1 parent 6bc9594 commit 2a722fc

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

sql/sql_acl.cc

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14268,22 +14268,9 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
1426814268
res= send_server_handshake_packet(mpvio, (char*) packet, packet_len);
1426914269
else if (mpvio->status == MPVIO_EXT::RESTART)
1427014270
res= send_plugin_request_packet(mpvio, packet, packet_len);
14271-
else if (packet_len > 0 && (*packet < 2 || *packet > 253))
14272-
{
14273-
/*
14274-
we cannot allow plugin data packet to start from 0, 255 or 254 -
14275-
as the client will treat it as an OK, ERROR or "change plugin" packet.
14276-
We'll escape these bytes with \1. Consequently, we
14277-
have to escape \1 byte too.
14278-
*/
14271+
else /* plugin data, prefixed with 1 */
1427914272
res= net_write_command(&mpvio->auth_info.thd->net, 1, (uchar*)"", 0,
1428014273
packet, packet_len);
14281-
}
14282-
else
14283-
{
14284-
res= my_net_write(&mpvio->auth_info.thd->net, packet, packet_len) ||
14285-
net_flush(&mpvio->auth_info.thd->net);
14286-
}
1428714274
mpvio->status= MPVIO_EXT::FAILURE; // the status is no longer RESTART
1428814275
mpvio->packets_written++;
1428914276
DBUG_RETURN(res);

0 commit comments

Comments
 (0)