diff options
author | Michael Widenius <monty@askmonty.org> | 2010-03-31 21:37:45 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-03-31 21:37:45 +0300 |
commit | fee40e27738122d5c7d7916a1cfa8cd2b5a20186 (patch) | |
tree | 2decdda4d5883490a6dbd427afb8c2f7eeb93212 /plugin | |
parent | 515c2db0304fcf3b88cf6017ec36579ba5447108 (diff) | |
download | mariadb-git-fee40e27738122d5c7d7916a1cfa8cd2b5a20186.tar.gz |
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
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/auth/dialog.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 71dc2239fd0..c80cbebd046 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -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); |