Commit fee40e27 authored by Michael Widenius's avatar Michael Widenius

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
parent 515c2db0
......@@ -291,7 +291,7 @@ struct charset_info_st
const uint16 *const *sort_order_big;
const uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
const MY_UNICASE_INFO *const *caseinfo;
MY_UNICASE_INFO *const *caseinfo;
const uchar *state_map;
const uchar *ident_map;
uint strxfrm_multiply;
......
......@@ -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);
......
......@@ -161,7 +161,10 @@ static LEX_STRING old_password_plugin_name= {
/// @todo make it configurable
LEX_STRING *default_auth_plugin_name= &native_password_plugin_name;
static plugin_ref native_password_plugin, old_password_plugin;
static plugin_ref native_password_plugin;
#ifndef EMBEDDED_LIBRARY
static plugin_ref old_password_plugin;
#endif
/* Classes */
......
......@@ -1215,8 +1215,6 @@ static int pbxt_init(void *p)
THD *thd = NULL;
#ifndef DRIZZLED
extern myxt_mutex_t LOCK_plugin;
/* {MYSQL QUIRK}
* I have to release this lock for PBXT recovery to
* work, because it needs to open .frm files.
......
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