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
09b63917
Commit
09b63917
authored
Nov 10, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user
parent
ab2bf1ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/suite/roles/show_grants_anon-5238.result
mysql-test/suite/roles/show_grants_anon-5238.result
+12
-0
mysql-test/suite/roles/show_grants_anon-5238.test
mysql-test/suite/roles/show_grants_anon-5238.test
+17
-0
sql/sql_acl.cc
sql/sql_acl.cc
+1
-1
No files found.
mysql-test/suite/roles/show_grants_anon-5238.result
0 → 100644
View file @
09b63917
create user ''@localhost;
create role r1;
grant r1 to ''@localhost;
select current_user;
current_user
@localhost
show grants;
Grants for @localhost
GRANT r1 TO ''@'localhost'
GRANT USAGE ON *.* TO ''@'localhost'
drop role r1;
drop user ''@localhost;
mysql-test/suite/roles/show_grants_anon-5238.test
0 → 100644
View file @
09b63917
#
# MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user
#
--
source
include
/
not_embedded
.
inc
create
user
''
@
localhost
;
create
role
r1
;
grant
r1
to
''
@
localhost
;
--
connect
(
con1
,
localhost
,
nonexisting_user
,,)
select
current_user
;
show
grants
;
connection
default
;
drop
role
r1
;
drop
user
''
@
localhost
;
sql/sql_acl.cc
View file @
09b63917
...
@@ -7556,7 +7556,7 @@ static ROLE_GRANT_PAIR *find_role_grant_pair(const LEX_STRING *u,
...
@@ -7556,7 +7556,7 @@ static ROLE_GRANT_PAIR *find_role_grant_pair(const LEX_STRING *u,
pair_key
.
alloc
(
key_length
);
pair_key
.
alloc
(
key_length
);
strmov
(
strmov
(
strmov
(
const_cast
<
char
*>
(
pair_key
.
ptr
()),
strmov
(
strmov
(
strmov
(
const_cast
<
char
*>
(
pair_key
.
ptr
()),
u
->
str
)
+
1
,
h
->
str
)
+
1
,
r
->
str
);
safe_str
(
u
->
str
)
)
+
1
,
h
->
str
)
+
1
,
r
->
str
);
return
(
ROLE_GRANT_PAIR
*
)
return
(
ROLE_GRANT_PAIR
*
)
my_hash_search
(
&
acl_roles_mappings
,
(
uchar
*
)
pair_key
.
ptr
(),
key_length
);
my_hash_search
(
&
acl_roles_mappings
,
(
uchar
*
)
pair_key
.
ptr
(),
key_length
);
...
...
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