Commit 8c5be01b authored by Georgi Kodinov's avatar Georgi Kodinov

Bug #57744: sql-common/client.c: Missing DBUG_RETURN macro

- added missing DBUG_RETURN
- fixed whitespace according to coding style.
parent 117c19c2
......@@ -4197,7 +4197,7 @@ static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
int pkt_len;
uchar *pkt;
DBUG_ENTER ("native_password_auth_client");
DBUG_ENTER("native_password_auth_client");
if (((MCPVIO_EXT *)vio)->mysql_change_user)
......@@ -4213,10 +4213,10 @@ static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
{
/* read the scramble */
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
return CR_ERROR;
DBUG_RETURN(CR_ERROR);
if (pkt_len != SCRAMBLE_LENGTH + 1)
DBUG_RETURN (CR_SERVER_HANDSHAKE_ERR);
DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
memcpy(mysql->scramble, pkt, SCRAMBLE_LENGTH);
......@@ -4226,19 +4226,19 @@ static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
if (mysql->passwd[0])
{
char scrambled[SCRAMBLE_LENGTH + 1];
DBUG_PRINT ("info", ("sending scramble"));
DBUG_PRINT("info", ("sending scramble"));
scramble(scrambled, (char*)pkt, mysql->passwd);
if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH))
DBUG_RETURN (CR_ERROR);
DBUG_RETURN(CR_ERROR);
}
else
{
DBUG_PRINT ("info", ("no password"));
DBUG_PRINT("info", ("no password"));
if (vio->write_packet(vio, 0, 0)) /* no password */
DBUG_RETURN (CR_ERROR);
DBUG_RETURN(CR_ERROR);
}
DBUG_RETURN (CR_OK);
DBUG_RETURN(CR_OK);
}
/**
......@@ -4250,7 +4250,7 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
uchar *pkt;
int pkt_len;
DBUG_ENTER ("old_password_auth_client");
DBUG_ENTER("old_password_auth_client");
if (((MCPVIO_EXT *)vio)->mysql_change_user)
{
......@@ -4265,11 +4265,11 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
{
/* read the scramble */
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
return CR_ERROR;
DBUG_RETURN(CR_ERROR);
if (pkt_len != SCRAMBLE_LENGTH_323 + 1 &&
pkt_len != SCRAMBLE_LENGTH + 1)
DBUG_RETURN (CR_SERVER_HANDSHAKE_ERR);
DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
memcpy(mysql->scramble, pkt, pkt_len);
......@@ -4281,11 +4281,11 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
char scrambled[SCRAMBLE_LENGTH_323 + 1];
scramble_323(scrambled, (char*)pkt, mysql->passwd);
if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH_323 + 1))
DBUG_RETURN (CR_ERROR);
DBUG_RETURN(CR_ERROR);
}
else
if (vio->write_packet(vio, 0, 0)) /* no password */
DBUG_RETURN (CR_ERROR);
DBUG_RETURN(CR_ERROR);
DBUG_RETURN (CR_OK);
DBUG_RETURN(CR_OK);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment