From 1fea7e785f2de734fb3e278c9c0df2776f565c06 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 23 Jan 2016 16:08:24 +0100 Subject: cleanup: create LEX_USER::reset_auth() as this is used quite often --- sql/structs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index 191463af344..986b0d64bb0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -211,6 +211,12 @@ typedef struct st_lex_user { else l->length= strxmov(l->str= buf, user.str, "@", host.str, NullS) - buf; } + void reset_auth() + { + password.length= plugin.length= auth.length= 0; + password.str= 0; + plugin.str= auth.str= const_cast(""); + } } LEX_USER; /* -- cgit v1.2.1 From c37107380abf8f4c04c270ee7afdf8e16042c943 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 23 Jan 2016 16:24:32 +0100 Subject: cleanup: LEX_USER::pwtext and LEX_USER::pwhash Was: * LEX_USER::password was storing sometimes plaintext password and sometimes password hash * LEX_USER::auth was storing sometimes password hash and sometimes plugin authentication string Now: * LEX_USER::pwtext stores the password in plain-text * LEX_USER::pwhash stores the password hash * LEX_USER::auth stores the plugin authentication string --- sql/structs.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index 986b0d64bb0..c1c832d07ec 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -202,7 +202,8 @@ extern const char *show_comp_option_name[]; typedef int *(*update_var)(THD *, struct st_mysql_show_var *); typedef struct st_lex_user { - LEX_STRING user, host, password, plugin, auth; + LEX_STRING user, host, plugin, auth; + LEX_STRING pwtext, pwhash; bool is_role() { return user.str[0] && !host.str[0]; } void set_lex_string(LEX_STRING *l, char *buf) { @@ -213,8 +214,8 @@ typedef struct st_lex_user { } void reset_auth() { - password.length= plugin.length= auth.length= 0; - password.str= 0; + pwtext.length= pwhash.length= plugin.length= auth.length= 0; + pwtext.str= pwhash.str= 0; plugin.str= auth.str= const_cast(""); } } LEX_USER; -- cgit v1.2.1