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
48e2d153
Commit
48e2d153
authored
Sep 02, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #928 - arbitrary table grant was used, sort-order wasn't honored
parent
c3f54ad9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
sql/sql_acl.cc
sql/sql_acl.cc
+7
-3
No files found.
sql/sql_acl.cc
View file @
48e2d153
...
...
@@ -1204,6 +1204,7 @@ class GRANT_TABLE :public Sql_alloc
public:
char
*
host
,
*
db
,
*
user
,
*
tname
,
*
hash_key
;
uint
privs
,
cols
,
key_length
;
ulong
sort
;
HASH
hash_columns
;
GRANT_TABLE
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
,
uint
p
,
uint
c
)
...
...
@@ -1212,6 +1213,7 @@ class GRANT_TABLE :public Sql_alloc
host
=
strdup_root
(
&
memex
,
h
);
db
=
strdup_root
(
&
memex
,
d
);
user
=
strdup_root
(
&
memex
,
u
);
sort
=
get_sort
(
3
,
host
,
db
,
user
);
tname
=
strdup_root
(
&
memex
,
t
);
key_length
=
(
uint
)
strlen
(
d
)
+
(
uint
)
strlen
(
u
)
+
(
uint
)
strlen
(
t
)
+
3
;
hash_key
=
(
char
*
)
alloc_root
(
&
memex
,
key_length
);
...
...
@@ -1227,6 +1229,7 @@ class GRANT_TABLE :public Sql_alloc
host
=
get_field
(
&
memex
,
form
,
0
);
db
=
get_field
(
&
memex
,
form
,
1
);
user
=
get_field
(
&
memex
,
form
,
2
);
if
(
!
user
)
user
=
(
char
*
)
""
;
sort
=
get_sort
(
3
,
host
,
db
,
user
);
tname
=
get_field
(
&
memex
,
form
,
3
);
if
(
!
host
||
!
db
||
!
tname
)
{
...
...
@@ -1324,9 +1327,10 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
}
else
{
if
((
host
&&
!
wild_case_compare
(
host
,
grant_table
->
host
))
||
(
ip
&&
!
wild_case_compare
(
ip
,
grant_table
->
host
)))
found
=
grant_table
;
// Host ok
if
(((
host
&&
!
wild_case_compare
(
host
,
grant_table
->
host
))
||
(
ip
&&
!
wild_case_compare
(
ip
,
grant_table
->
host
)))
&&
(
!
found
||
found
->
sort
<
grant_table
->
sort
))
found
=
grant_table
;
}
}
return
found
;
...
...
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