mirror of
https://github.com/MariaDB/server.git
synced 2026-04-20 15:25:33 +02:00
Fixed some compiler warnings
include/m_ctype.h: MY_UNICASE_INFO already includes 'const' plugin/auth/dialog.c: Fixed parameters to have correct signed/unsigned type sql/sql_acl.cc: old_password_plugin is not used for EMBEDDED_LIBRARY storage/pbxt/src/ha_pbxt.cc: Remove not used variable
This commit is contained in:
parent
515c2db030
commit
fee40e2773
4 changed files with 19 additions and 12 deletions
|
|
@ -51,6 +51,8 @@
|
|||
#define PASSWORD_QUESTION "\4"
|
||||
#define LAST_PASSWORD "\5"
|
||||
|
||||
typedef unsigned char uchar;
|
||||
|
||||
/********************* SERVER SIDE ****************************************/
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +65,9 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
int pkt_len;
|
||||
|
||||
/* send a password question */
|
||||
if (vio->write_packet(vio, PASSWORD_QUESTION "Password, please:", 18))
|
||||
if (vio->write_packet(vio,
|
||||
(const uchar*) (PASSWORD_QUESTION "Password, please:"),
|
||||
18))
|
||||
return CR_ERROR;
|
||||
|
||||
/* read the answer */
|
||||
|
|
@ -73,11 +77,12 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
info->password_used = 1;
|
||||
|
||||
/* fail if the password is wrong */
|
||||
if (strcmp(pkt, info->auth_string))
|
||||
if (strcmp((char*) pkt, info->auth_string))
|
||||
return CR_ERROR;
|
||||
|
||||
/* send the last, ordinary, question */
|
||||
if (vio->write_packet(vio, LAST_QUESTION "Are you sure ?", 15))
|
||||
if (vio->write_packet(vio,
|
||||
(const uchar*) (LAST_QUESTION "Are you sure ?"), 15))
|
||||
return CR_ERROR;
|
||||
|
||||
/* read the answer */
|
||||
|
|
@ -85,7 +90,7 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
return CR_ERROR;
|
||||
|
||||
/* check the reply */
|
||||
return strcmp(pkt, "yes, of course") ? CR_ERROR : CR_OK;
|
||||
return strcmp((char*) pkt, "yes, of course") ? CR_ERROR : CR_OK;
|
||||
}
|
||||
|
||||
static struct st_mysql_auth two_handler=
|
||||
|
|
@ -108,7 +113,8 @@ static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
for (i= 0; i < 3; i++)
|
||||
{
|
||||
/* send the prompt */
|
||||
if (vio->write_packet(vio, PASSWORD_QUESTION "Password, please:", 18))
|
||||
if (vio->write_packet(vio,
|
||||
(const uchar*) (PASSWORD_QUESTION "Password, please:"), 18))
|
||||
return CR_ERROR;
|
||||
|
||||
/* read the password */
|
||||
|
|
@ -121,7 +127,7 @@ static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
finish, if the password is correct.
|
||||
note, that we did not mark the prompt packet as "last"
|
||||
*/
|
||||
if (strcmp(pkt, info->auth_string) == 0)
|
||||
if (strcmp((char*) pkt, info->auth_string) == 0)
|
||||
return CR_OK;
|
||||
}
|
||||
|
||||
|
|
@ -255,12 +261,12 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
|||
if ((cmd >> 1) == 2 && *pkt == 0)
|
||||
reply= mysql->passwd;
|
||||
else
|
||||
reply= ask(mysql, cmd >> 1, pkt, reply_buf, sizeof(reply_buf));
|
||||
reply= ask(mysql, cmd >> 1, (char*) pkt, reply_buf, sizeof(reply_buf));
|
||||
if (!reply)
|
||||
return CR_ERROR;
|
||||
}
|
||||
/* send the reply to the server */
|
||||
res= vio->write_packet(vio, reply, strlen(reply)+1);
|
||||
res= vio->write_packet(vio, (uchar*) reply, strlen(reply)+1);
|
||||
|
||||
if (reply != mysql->passwd && reply != reply_buf)
|
||||
free(reply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue