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
c7467168
Commit
c7467168
authored
Feb 03, 2010
by
Alexander Nozdrin
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge from mysql-trunk-merge.
Conflicts: - sql/sql_show.cc
parents
4a6457c8
679de2bb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
4 deletions
+53
-4
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+22
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+27
-0
sql/sql_show.cc
sql/sql_show.cc
+4
-4
No files found.
mysql-test/r/information_schema.result
View file @
c7467168
...
...
@@ -1659,6 +1659,28 @@ SELECT 'OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
TEST_RESULT
OK
SET TIMESTAMP=DEFAULT;
#
# Bug #50276: Security flaw in INFORMATION_SCHEMA.TABLES
#
CREATE DATABASE db1;
USE db1;
CREATE TABLE t1 (id INT);
CREATE USER nonpriv;
USE test;
# connected as nonpriv
# Should return 0
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
COUNT(*)
0
USE INFORMATION_SCHEMA;
# Should return 0
SELECT COUNT(*) FROM TABLES WHERE TABLE_NAME='t1';
COUNT(*)
0
# connected as root
DROP USER nonpriv;
DROP TABLE db1.t1;
DROP DATABASE db1;
End of 5.1 tests.
create table information_schema.t1 (f1 INT);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
...
...
mysql-test/t/information_schema.test
View file @
c7467168
...
...
@@ -1389,6 +1389,33 @@ SET TIMESTAMP=@@TIMESTAMP + 10000000;
SELECT
'OK'
AS
TEST_RESULT
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
time
<
0
;
SET
TIMESTAMP
=
DEFAULT
;
--
echo
#
--
echo
# Bug #50276: Security flaw in INFORMATION_SCHEMA.TABLES
--
echo
#
CREATE
DATABASE
db1
;
USE
db1
;
CREATE
TABLE
t1
(
id
INT
);
CREATE
USER
nonpriv
;
USE
test
;
connect
(
nonpriv_con
,
localhost
,
nonpriv
,,);
connection
nonpriv_con
;
--
echo
# connected as nonpriv
--
echo
# Should return 0
SELECT
COUNT
(
*
)
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_NAME
=
't1'
;
USE
INFORMATION_SCHEMA
;
--
echo
# Should return 0
SELECT
COUNT
(
*
)
FROM
TABLES
WHERE
TABLE_NAME
=
't1'
;
connection
default
;
--
echo
# connected as root
disconnect
nonpriv_con
;
DROP
USER
nonpriv
;
DROP
TABLE
db1
.
t1
;
DROP
DATABASE
db1
;
--
echo
End
of
5.1
tests
.
#
...
...
sql/sql_show.cc
View file @
c7467168
...
...
@@ -3317,11 +3317,11 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
while
((
db_name
=
it
++
))
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if
(
!
check_access
(
thd
,
SELECT_ACL
,
db_name
->
str
,
if
(
!
(
check_access
(
thd
,
SELECT_ACL
,
db_name
->
str
,
&
thd
->
col_access
,
NULL
,
0
,
1
)
||
(
!
thd
->
col_access
&&
check_grant_db
(
thd
,
db_name
->
str
)))
||
sctx
->
master_access
&
(
DB_ACLS
|
SHOW_DB_ACL
)
||
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db_name
->
str
,
0
)
||
!
check_grant_db
(
thd
,
db_name
->
str
))
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db_name
->
str
,
0
))
#endif
{
thd
->
no_warnings_for_error
=
1
;
...
...
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