summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorkostja@oak.local <>2003-07-18 18:25:54 +0400
committerkostja@oak.local <>2003-07-18 18:25:54 +0400
commit09e53b016967a84126dc50474a54010712893bf1 (patch)
treeff6daa4950597380db94c038c04c9a8067bbfd68 /libmysql
parentd90129d1e9ffda725173047a8195902185208ce4 (diff)
downloadmariadb-git-09e53b016967a84126dc50474a54010712893bf1.tar.gz
Style fixes, comments for 4.1.1 authorization
Now special 1-byte packet is used for request of old password Fixed bug with --skip-grant-tables and acl_getroot
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index ee7fd6a2576..cec9980bae7 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -626,7 +626,10 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
end+= SCRAMBLE_LENGTH;
}
else
- end= scramble_323(end, mysql->scramble_323, passwd);
+ {
+ scramble_323(end, mysql->scramble, passwd);
+ end+= SCRAMBLE_LENGTH_323 + 1;
+ }
}
else
*end++= '\0'; // empty password
@@ -642,15 +645,14 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
if (pkt_length == packet_error)
goto error;
- if (net->read_pos[0] == mysql->scramble_323[0] &&
- pkt_length == SCRAMBLE_LENGTH_323 + 1 &&
+ if (pkt_length == 1 && net->read_pos[0] == 254 &&
mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
{
/*
By sending this very specific reply server asks us to send scrambled
password in old format. The reply contains scramble_323.
*/
- scramble_323(buff, mysql->scramble_323, passwd);
+ scramble_323(buff, mysql->scramble, passwd);
if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
{
net->last_errno= CR_SERVER_LOST;