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
14ddcb1f
Commit
14ddcb1f
authored
Aug 02, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
A test case and a followup fix
parent
43c393ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
mysql-test/r/sp-security.result
mysql-test/r/sp-security.result
+21
-0
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+18
-1
sql/sql_acl.cc
sql/sql_acl.cc
+1
-1
No files found.
mysql-test/r/sp-security.result
View file @
14ddcb1f
...
...
@@ -617,3 +617,24 @@ SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
# Connection default
DROP USER user2@localhost;
DROP DATABASE db1;
create user foo@local_ost;
create user foo@`local\_ost` identified by 'nevermore';
create database foodb;
grant create routine on foodb.* to foo@local_ost;
select user(), current_user();
user() current_user()
foo@localhost foo@local_ost
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'local_ost'
drop user foo@local_ost;
drop user foo@`local\_ost`;
drop procedure fooproc;
drop database foodb;
mysql-test/t/sp-security.test
View file @
14ddcb1f
...
...
@@ -995,7 +995,24 @@ disconnect con2;
DROP USER user2@localhost;
DROP DATABASE db1;
#
# Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
#
create user foo@local_ost;
create user foo@`
local\_ost
` identified by 'nevermore';
create database foodb;
grant create routine on foodb.* to foo@local_ost;
connect con1,localhost,foo;
select user(), current_user();
show grants;
create procedure fooproc() select 'i am fooproc';
show grants;
disconnect con1;
connection default;
drop user foo@local_ost;
drop user foo@`
local\_ost
`
;
drop
procedure
fooproc
;
drop
database
foodb
;
# Wait till all disconnects are completed
--
source
include
/
wait_until_count_sessions
.
inc
sql/sql_acl.cc
View file @
14ddcb1f
...
...
@@ -7190,7 +7190,7 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
mysql_mutex_lock
(
&
acl_cache
->
lock
);
if
((
au
=
find_acl_user
(
combo
->
host
.
str
=
(
char
*
)
sctx
->
priv_host
,
combo
->
user
.
str
,
FALS
E
)))
combo
->
user
.
str
,
TRU
E
)))
goto
found_acl
;
mysql_mutex_unlock
(
&
acl_cache
->
lock
);
...
...
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