Commit c917474e authored by unknown's avatar unknown

Add proper error message for old client connecting new server using user which has password in

new format SCRUM


include/mysqld_error.h:
  Add new error message
sql/share/czech/errmsg.txt:
  czech
sql/share/danish/errmsg.txt:
  danish
sql/share/dutch/errmsg.txt:
  dutch
sql/share/english/errmsg.txt:
  New Error message for in case old client connects new server and new auth is to be used
sql/share/estonian/errmsg.txt:
  estonian
sql/share/french/errmsg.txt:
  french
sql/share/german/errmsg.txt:
  german
sql/share/greek/errmsg.txt:
  greek
sql/share/hungarian/errmsg.txt:
  hungarian
sql/share/italian/errmsg.txt:
  italian
sql/share/japanese/errmsg.txt:
  japaneese
sql/share/korean/errmsg.txt:
  korean
sql/share/norwegian-ny/errmsg.txt:
  norwegian-ny
sql/share/norwegian/errmsg.txt:
  norwegian
sql/share/polish/errmsg.txt:
  polish
sql/share/portuguese/errmsg.txt:
  portuguese
sql/share/romanian/errmsg.txt:
  romanian
sql/share/russian/errmsg.txt:
  russian
sql/share/serbian/errmsg.txt:
  se
sql/share/slovak/errmsg.txt:
  slovak
sql/share/spanish/errmsg.txt:
  spanish
sql/share/swedish/errmsg.txt:
  swedish
sql/share/ukrainian/errmsg.txt:
  ukrainian
sql/sql_parse.cc:
  Add proper error message if old clients can't authenticate due to unsupported protocol
  SCRUM
parent a417e7b6
...@@ -265,4 +265,5 @@ ...@@ -265,4 +265,5 @@
#define ER_DERIVED_MUST_HAVE_ALIAS 1246 #define ER_DERIVED_MUST_HAVE_ALIAS 1246
#define ER_SELECT_REDUCED 1247 #define ER_SELECT_REDUCED 1247
#define ER_TABLENAME_NOT_ALLOWED_HERE 1248 #define ER_TABLENAME_NOT_ALLOWED_HERE 1248
#define ER_ERROR_MESSAGES 249 #define ER_NOT_SUPPORTED_AUTH_MODE 1249
#define ER_ERROR_MESSAGES 250
...@@ -259,3 +259,4 @@ v/* ...@@ -259,3 +259,4 @@ v/*
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -253,3 +253,4 @@ ...@@ -253,3 +253,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -261,3 +261,4 @@ ...@@ -261,3 +261,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias", "Every derived table must have it's own alias",
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -255,3 +255,4 @@ ...@@ -255,3 +255,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -260,3 +260,4 @@ ...@@ -260,3 +260,4 @@
"Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden.", "Für jede abgeleitete Tabelle muss ein eigener Alias angegeben werden.",
"Select %u wurde während der Optimierung reduziert.", "Select %u wurde während der Optimierung reduziert.",
"Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden." "Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden."
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -252,3 +252,4 @@ ...@@ -252,3 +252,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -252,3 +252,4 @@ ...@@ -252,3 +252,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -252,3 +252,4 @@ ...@@ -252,3 +252,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -252,3 +252,4 @@ ...@@ -252,3 +252,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -254,3 +254,4 @@ ...@@ -254,3 +254,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -254,3 +254,4 @@ ...@@ -254,3 +254,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -253,3 +253,4 @@ ...@@ -253,3 +253,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u ", "Select %u ",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -246,3 +246,4 @@ ...@@ -246,3 +246,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -258,3 +258,4 @@ ...@@ -258,3 +258,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -251,3 +251,4 @@ ...@@ -251,3 +251,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -250,3 +250,4 @@ ...@@ -250,3 +250,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -255,3 +255,4 @@ ...@@ -255,3 +255,4 @@
"Every derived table must have it's own alias" "Every derived table must have it's own alias"
"Select %u was iii", "Select %u was iii",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
...@@ -189,9 +189,9 @@ static int get_or_create_user_conn(THD *thd, const char *user, ...@@ -189,9 +189,9 @@ static int get_or_create_user_conn(THD *thd, const char *user,
static int check_user(THD *thd,enum_server_command command, const char *user, static int check_user(THD *thd,enum_server_command command, const char *user,
const char *passwd, const char *db, bool check_count, const char *passwd, const char *db, bool check_count,
bool do_send_error, char* crypted_scramble, bool simple_connect, bool do_send_error,
bool had_password,uint *cur_priv_version, char* crypted_scramble, bool had_password,
ACL_USER** hint_user) uint *cur_priv_version, ACL_USER** hint_user)
{ {
thd->db=0; thd->db=0;
thd->db_length=0; thd->db_length=0;
...@@ -221,6 +221,14 @@ static int check_user(THD *thd,enum_server_command command, const char *user, ...@@ -221,6 +221,14 @@ static int check_user(THD *thd,enum_server_command command, const char *user,
if (thd->master_access & NO_ACCESS) if (thd->master_access & NO_ACCESS)
{ {
if (do_send_error) if (do_send_error)
{
/* Old client should get nicer error message if password version is not supported*/
if (simple_connect && *hint_user && (*hint_user)->pversion)
{
net_printf(thd, ER_NOT_SUPPORTED_AUTH_MODE);
mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
}
else
{ {
net_printf(thd, ER_ACCESS_DENIED_ERROR, net_printf(thd, ER_ACCESS_DENIED_ERROR,
thd->user, thd->user,
...@@ -230,6 +238,7 @@ static int check_user(THD *thd,enum_server_command command, const char *user, ...@@ -230,6 +238,7 @@ static int check_user(THD *thd,enum_server_command command, const char *user,
thd->user, thd->user,
thd->host_or_ip, thd->host_or_ip,
had_password ? ER(ER_YES) : ER(ER_NO)); had_password ? ER(ER_YES) : ER(ER_NO));
}
return(1); // Error already given return(1); // Error already given
} }
else else
...@@ -638,8 +647,9 @@ check_connections(THD *thd) ...@@ -638,8 +647,9 @@ check_connections(THD *thd)
/* Store information if we used password. passwd will be dammaged */ /* Store information if we used password. passwd will be dammaged */
bool using_password=test(passwd[0]); bool using_password=test(passwd[0]);
/* Check user permissions. If password failure we'll get scramble back */ /* Check user permissions. If password failure we'll get scramble back */
if (check_user(thd,COM_CONNECT, user, passwd, db, 1, simple_connect, if (check_user(thd, COM_CONNECT, user, passwd, db, 1, simple_connect,
prepared_scramble,using_password,&cur_priv_version,&cached_user)<0) simple_connect, prepared_scramble, using_password, &cur_priv_version,
&cached_user)<0)
{ {
/* If The client is old we just have to return error */ /* If The client is old we just have to return error */
if (simple_connect) if (simple_connect)
...@@ -679,7 +689,7 @@ check_connections(THD *thd) ...@@ -679,7 +689,7 @@ check_connections(THD *thd)
} }
/* Final attempt to check the user based on reply */ /* Final attempt to check the user based on reply */
if (check_user(thd,COM_CONNECT, tmp_user, (char*)net->read_pos, if (check_user(thd,COM_CONNECT, tmp_user, (char*)net->read_pos,
tmp_db, 1, 1,prepared_scramble,using_password,&cur_priv_version, tmp_db, 1, 0, 1, prepared_scramble, using_password, &cur_priv_version,
&cached_user)) &cached_user))
return -1; return -1;
} }
...@@ -1077,7 +1087,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1077,7 +1087,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
Do not retry if we already have sent error (result>0) Do not retry if we already have sent error (result>0)
*/ */
if (check_user(thd,COM_CHANGE_USER, user, passwd, db, 0, simple_connect, if (check_user(thd,COM_CHANGE_USER, user, passwd, db, 0, simple_connect,
prepared_scramble,using_password,&cur_priv_version,&cached_user)<0) simple_connect, prepared_scramble, using_password, &cur_priv_version,
&cached_user)<0)
{ {
/* If The client is old we just have to have auth failure */ /* If The client is old we just have to have auth failure */
if (simple_connect) if (simple_connect)
...@@ -1112,7 +1123,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1112,7 +1123,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Final attempt to check the user based on reply */ /* Final attempt to check the user based on reply */
if (check_user(thd,COM_CHANGE_USER, tmp_user, (char*)net->read_pos, if (check_user(thd,COM_CHANGE_USER, tmp_user, (char*)net->read_pos,
tmp_db, 0, 1,prepared_scramble,using_password,&cur_priv_version, tmp_db, 0, 0, 1, prepared_scramble, using_password, &cur_priv_version,
&cached_user)) &cached_user))
goto restore_user; goto restore_user;
} }
......
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