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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e73f13a7
Commit
e73f13a7
authored
Mar 19, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend check_global_access() to avoid my_error when it's not needed
(in INFORMATION_SCHEMA).
parent
db65e4f5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
37 deletions
+37
-37
sql/innodb_priv.h
sql/innodb_priv.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+8
-5
sql/sql_parse.h
sql/sql_parse.h
+1
-1
sql/sql_show.cc
sql/sql_show.cc
+4
-4
sql/sql_trigger.cc
sql/sql_trigger.cc
+0
-3
storage/xtradb/handler/i_s.cc
storage/xtradb/handler/i_s.cc
+23
-23
No files found.
sql/innodb_priv.h
View file @
e73f13a7
...
...
@@ -25,7 +25,7 @@ class THD;
int
get_quote_char_for_identifier
(
THD
*
thd
,
const
char
*
name
,
uint
length
);
bool
schema_table_store_record
(
THD
*
thd
,
TABLE
*
table
);
void
localtime_to_TIME
(
MYSQL_TIME
*
to
,
struct
tm
*
from
);
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
);
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
,
bool
no_errors
=
false
);
uint
strconvert
(
CHARSET_INFO
*
from_cs
,
const
char
*
from
,
CHARSET_INFO
*
to_cs
,
char
*
to
,
uint
to_length
,
uint
*
errors
);
...
...
sql/sql_parse.cc
View file @
e73f13a7
...
...
@@ -1630,7 +1630,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
break
;
case
SCH_USER_STATS
:
case
SCH_CLIENT_STATS
:
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
))
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
,
true
))
DBUG_RETURN
(
1
);
case
SCH_TABLE_STATS
:
case
SCH_INDEX_STATS
:
...
...
@@ -1805,7 +1805,7 @@ bool sp_process_definer(THD *thd)
if
((
strcmp
(
lex
->
definer
->
user
.
str
,
thd
->
security_ctx
->
priv_user
)
||
my_strcasecmp
(
system_charset_info
,
lex
->
definer
->
host
.
str
,
thd
->
security_ctx
->
priv_host
))
&&
check_global_access
(
thd
,
SUPER_ACL
))
check_global_access
(
thd
,
SUPER_ACL
,
true
))
{
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"SUPER"
);
DBUG_RETURN
(
TRUE
);
...
...
@@ -5316,14 +5316,17 @@ bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
1 Access denied. In this case an error is sent to the client
*/
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
)
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
,
bool
no_errors
)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
char
command
[
128
];
if
((
thd
->
security_ctx
->
master_access
&
want_access
))
return
0
;
get_privilege_desc
(
command
,
sizeof
(
command
),
want_access
);
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
command
);
if
(
!
no_errors
)
{
get_privilege_desc
(
command
,
sizeof
(
command
),
want_access
);
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
command
);
}
status_var_increment
(
thd
->
status_var
.
access_denied_errors
);
return
1
;
#else
...
...
sql/sql_parse.h
View file @
e73f13a7
...
...
@@ -196,7 +196,7 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
/* These were under the INNODB_COMPATIBILITY_HOOKS */
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
);
bool
check_global_access
(
THD
*
thd
,
ulong
want_access
,
bool
no_errors
=
false
);
inline
bool
is_supported_parser_charset
(
CHARSET_INFO
*
cs
)
{
...
...
sql/sql_show.cc
View file @
e73f13a7
...
...
@@ -2920,8 +2920,8 @@ int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
int
result
;
DBUG_ENTER
(
"fill_schema_user_stats"
);
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
))
DBUG_RETURN
(
1
);
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
,
true
))
DBUG_RETURN
(
0
);
/*
Iterates through all the global stats and sends them to the client.
...
...
@@ -2955,8 +2955,8 @@ int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
int
result
;
DBUG_ENTER
(
"fill_schema_client_stats"
);
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
))
DBUG_RETURN
(
1
);
if
(
check_global_access
(
thd
,
SUPER_ACL
|
PROCESS_ACL
,
true
))
DBUG_RETURN
(
0
);
/*
Iterates through all the global stats and sends them to the client.
...
...
sql/sql_trigger.cc
View file @
e73f13a7
...
...
@@ -701,10 +701,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
thd
->
security_ctx
->
priv_host
)))
{
if
(
check_global_access
(
thd
,
SUPER_ACL
))
{
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"SUPER"
);
return
TRUE
;
}
}
/*
...
...
storage/xtradb/handler/i_s.cc
View file @
e73f13a7
...
...
@@ -1210,7 +1210,7 @@ trx_i_s_common_fill_table(
DBUG_ENTER
(
"trx_i_s_common_fill_table"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -1370,7 +1370,7 @@ i_s_cmp_fill_low(
DBUG_ENTER
(
"i_s_cmp_fill_low"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -1642,7 +1642,7 @@ i_s_cmpmem_fill_low(
DBUG_ENTER
(
"i_s_cmpmem_fill_low"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -2275,7 +2275,7 @@ i_s_innodb_buffer_stats_fill_table(
DBUG_ENTER
(
"i_s_innodb_buffer_fill_general"
);
/* Only allow the PROCESS privilege holder to access the stats */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -2968,7 +2968,7 @@ i_s_innodb_buffer_page_fill_table(
DBUG_ENTER
(
"i_s_innodb_buffer_page_fill_table"
);
/* deny access to user without PROCESS privilege */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -3513,7 +3513,7 @@ i_s_innodb_buf_page_lru_fill_table(
DBUG_ENTER
(
"i_s_innodb_buf_page_lru_fill_table"
);
/* deny access to any users that do not hold PROCESS_ACL */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -3747,7 +3747,7 @@ i_s_sys_tables_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -4050,7 +4050,7 @@ i_s_sys_tables_fill_table_stats(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -4294,7 +4294,7 @@ i_s_sys_indexes_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -4531,7 +4531,7 @@ i_s_sys_columns_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -4733,7 +4733,7 @@ i_s_sys_fields_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -4962,7 +4962,7 @@ i_s_sys_foreign_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -5173,7 +5173,7 @@ i_s_sys_foreign_cols_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -5388,7 +5388,7 @@ i_s_sys_stats_fill_table(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -5574,7 +5574,7 @@ i_s_innodb_rseg_fill(
DBUG_ENTER
(
"i_s_innodb_rseg_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -5798,7 +5798,7 @@ i_s_innodb_table_stats_fill(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -5863,7 +5863,7 @@ i_s_innodb_index_stats_fill(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -6055,7 +6055,7 @@ i_s_innodb_admin_command_fill(
RETURN_IF_INNODB_NOT_STARTED
(
tables
->
schema_table_name
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -6432,7 +6432,7 @@ i_s_innodb_buffer_pool_pages_fill(
DBUG_ENTER
(
"i_s_innodb_buffer_pool_pages_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -6537,7 +6537,7 @@ i_s_innodb_buffer_pool_pages_index_fill(
DBUG_ENTER
(
"i_s_innodb_buffer_pool_pages_index_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -6606,7 +6606,7 @@ i_s_innodb_buffer_pool_pages_blob_fill(
DBUG_ENTER
(
"i_s_innodb_buffer_pool_pages_blob_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -7010,7 +7010,7 @@ i_s_innodb_undo_logs_fill(
DBUG_ENTER
(
"i_s_innodb_undo_logs_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
@@ -7336,7 +7336,7 @@ i_s_innodb_changed_pages_fill(
DBUG_ENTER
(
"i_s_innodb_changed_pages_fill"
);
/* deny access to non-superusers */
if
(
check_global_access
(
thd
,
PROCESS_ACL
))
{
if
(
check_global_access
(
thd
,
PROCESS_ACL
,
true
))
{
DBUG_RETURN
(
0
);
}
...
...
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