Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1fea7e78
Commit
1fea7e78
authored
Jan 23, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: create LEX_USER::reset_auth()
as this is used quite often
parent
b01e2ff1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
23 deletions
+15
-23
sql/sql_acl.cc
sql/sql_acl.cc
+2
-4
sql/sql_class.cc
sql/sql_class.cc
+1
-3
sql/sql_parse.cc
sql/sql_parse.cc
+2
-4
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-12
sql/structs.h
sql/structs.h
+6
-0
No files found.
sql/sql_acl.cc
View file @
1fea7e78
...
...
@@ -984,7 +984,7 @@ static bool fix_user_plugin_ptr(ACL_USER *user)
- if user->plugin is specified, user->auth is the plugin auth data.
- if user->plugin is mysql_native_password or mysql_old_password,
user->auth i
f
the password hash, and LEX_USER is transformed
user->auth i
s
the password hash, and LEX_USER is transformed
to match the next case (that is, user->plugin is cleared).
- if user->plugin is NOT specified, built-in auth is assumed, that is
mysql_native_password or mysql_old_password. In that case,
...
...
@@ -10156,9 +10156,7 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
thd
->
make_lex_string
(
&
combo
->
user
,
combo
->
user
.
str
,
strlen
(
combo
->
user
.
str
));
thd
->
make_lex_string
(
&
combo
->
host
,
combo
->
host
.
str
,
strlen
(
combo
->
host
.
str
));
combo
->
password
=
null_lex_str
;
combo
->
plugin
=
empty_lex_str
;
combo
->
auth
=
empty_lex_str
;
combo
->
reset_auth
();
if
(
au
)
{
...
...
sql/sql_class.cc
View file @
1fea7e78
...
...
@@ -5160,9 +5160,7 @@ void THD::get_definer(LEX_USER *definer, bool role)
{
definer
->
user
=
invoker_user
;
definer
->
host
=
invoker_host
;
definer
->
password
=
null_lex_str
;
definer
->
plugin
=
empty_lex_str
;
definer
->
auth
=
empty_lex_str
;
definer
->
reset_auth
();
}
else
#endif
...
...
sql/sql_parse.cc
View file @
1fea7e78
...
...
@@ -8949,9 +8949,7 @@ void get_default_definer(THD *thd, LEX_USER *definer, bool role)
}
definer
->
user
.
length
=
strlen
(
definer
->
user
.
str
);
definer
->
password
=
null_lex_str
;
definer
->
plugin
=
empty_lex_str
;
definer
->
auth
=
empty_lex_str
;
definer
->
reset_auth
();
}
...
...
@@ -9009,7 +9007,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
definer
->
user
=
*
user_name
;
definer
->
host
=
*
host_name
;
definer
->
password
=
null_lex_str
;
definer
->
reset_auth
()
;
return
definer
;
}
...
...
sql/sql_yacc.yy
View file @
1fea7e78
...
...
@@ -14139,9 +14139,7 @@ user_maybe_role:
MYSQL_YYABORT;
$$->user = $1;
$$->host= null_lex_str; // User or Role, see get_current_user()
$$->password= null_lex_str;
$$->plugin= empty_lex_str;
$$->auth= empty_lex_str;
$$->reset_auth();
if (check_string_char_length(&$$->user, ER_USERNAME,
username_char_length,
...
...
@@ -14153,9 +14151,7 @@ user_maybe_role:
if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
MYSQL_YYABORT;
$$->user = $1; $$->host=$3;
$$->password= null_lex_str;
$$->plugin= empty_lex_str;
$$->auth= empty_lex_str;
$$->reset_auth();
if (check_string_char_length(&$$->user, ER_USERNAME,
username_char_length,
...
...
@@ -15417,9 +15413,7 @@ current_role:
if (!($$=(LEX_USER*) thd->calloc(sizeof(LEX_USER))))
MYSQL_YYABORT;
$$->user= current_role;
$$->password= null_lex_str;
$$->plugin= empty_lex_str;
$$->auth= empty_lex_str;
$$->reset_auth();
}
;
...
...
@@ -15438,9 +15432,7 @@ grant_role:
MYSQL_YYABORT;
$$->user = $1;
$$->host= empty_lex_str;
$$->password= null_lex_str;
$$->plugin= empty_lex_str;
$$->auth= empty_lex_str;
$$->reset_auth();
if (check_string_char_length(&$$->user, ER_USERNAME,
username_char_length,
...
...
sql/structs.h
View file @
1fea7e78
...
...
@@ -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
<
char
*>
(
""
);
}
}
LEX_USER
;
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment