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
d8a6c1ca
Commit
d8a6c1ca
authored
May 14, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for checking global_access rights
parent
717cbb6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
sql/sql_parse.cc
sql/sql_parse.cc
+23
-8
No files found.
sql/sql_parse.cc
View file @
d8a6c1ca
...
...
@@ -1482,9 +1482,8 @@ mysql_execute_command(void)
}
case
SQLCOM_SHOW_SLAVE_STAT
:
{
/* Accept two privileges */
if
(
check_global_access
(
thd
,
SUPER_ACL
)
&&
check_global_access
(
thd
,
REPL_CLIENT_ACL
))
/* Accept one of two privileges */
if
(
check_global_access
(
thd
,
SUPER_ACL
|
REPL_CLIENT_ACL
))
goto
error
;
LOCK_ACTIVE_MI
;
res
=
show_master_info
(
thd
,
active_mi
);
...
...
@@ -1493,9 +1492,8 @@ mysql_execute_command(void)
}
case
SQLCOM_SHOW_MASTER_STAT
:
{
/* Accept two privileges */
if
(
check_global_access
(
thd
,
SUPER_ACL
)
&&
check_global_access
(
thd
,
REPL_CLIENT_ACL
))
/* Accept one of two privileges */
if
(
check_global_access
(
thd
,
SUPER_ACL
|
REPL_CLIENT_ACL
))
goto
error
;
res
=
show_binlog_info
(
thd
);
break
;
...
...
@@ -2620,12 +2618,29 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
}
/* check for global access and give descriptive error message if it fails */
/*
check for global access and give descriptive error message if it fails
SYNOPSIS
check_global_access()
thd Thread handler
want_access Use should have any of these global rights
WARNING
One gets access rigth if one has ANY of the rights in want_access
This is useful as one in most cases only need one global right,
but in some case we want to check if the user has SUPER or
REPL_CLIENT_ACL rights.
RETURN
0 ok
1 Access denied. In this case an error is sent to the client
*/
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
)
{
char
command
[
128
];
if
((
thd
->
master_access
&
want_access
)
==
want_access
)
if
((
thd
->
master_access
&
want_access
))
return
0
;
get_privilege_desc
(
command
,
sizeof
(
command
),
want_access
);
net_printf
(
&
thd
->
net
,
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
...
...
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