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
fc0d9a47
Commit
fc0d9a47
authored
Jan 09, 2021
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables
parent
69f1adaa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
mysql-test/r/skip_grants.result
mysql-test/r/skip_grants.result
+8
-0
mysql-test/t/skip_grants.test
mysql-test/t/skip_grants.test
+11
-0
sql/sql_acl.cc
sql/sql_acl.cc
+6
-0
No files found.
mysql-test/r/skip_grants.result
View file @
fc0d9a47
...
@@ -99,3 +99,11 @@ Acl_users 0
...
@@ -99,3 +99,11 @@ Acl_users 0
#
#
# End of 10.1 tests
# End of 10.1 tests
#
#
#
# MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables
#
set role x;
ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
#
# End of 10.2 tests
#
mysql-test/t/skip_grants.test
View file @
fc0d9a47
...
@@ -128,3 +128,14 @@ show global status like 'Acl%';
...
@@ -128,3 +128,14 @@ show global status like 'Acl%';
--
echo
#
--
echo
#
--
echo
# End of 10.1 tests
--
echo
# End of 10.1 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables
--
echo
#
--
error
ER_OPTION_PREVENTS_STATEMENT
set
role
x
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
sql/sql_acl.cc
View file @
fc0d9a47
...
@@ -2770,6 +2770,12 @@ static int check_user_can_set_role(THD *thd, const char *user, const char *host,
...
@@ -2770,6 +2770,12 @@ static int check_user_can_set_role(THD *thd, const char *user, const char *host,
int
acl_check_setrole
(
THD
*
thd
,
char
*
rolename
,
ulonglong
*
access
)
int
acl_check_setrole
(
THD
*
thd
,
char
*
rolename
,
ulonglong
*
access
)
{
{
if
(
!
initialized
)
{
my_error
(
ER_OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
"--skip-grant-tables"
);
return
1
;
}
return
check_user_can_set_role
(
thd
,
thd
->
security_ctx
->
priv_user
,
return
check_user_can_set_role
(
thd
,
thd
->
security_ctx
->
priv_user
,
thd
->
security_ctx
->
host
,
thd
->
security_ctx
->
ip
,
rolename
,
access
);
thd
->
security_ctx
->
host
,
thd
->
security_ctx
->
ip
,
rolename
,
access
);
}
}
...
...
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