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
72c9ac84
Commit
72c9ac84
authored
Mar 26, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for "backport wild_compare fix from 4.1 - bug#3924"
parent
6ddcfe37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
sql/sql_acl.cc
sql/sql_acl.cc
+6
-2
sql/sql_parse.cc
sql/sql_parse.cc
+2
-2
No files found.
sql/sql_acl.cc
View file @
72c9ac84
...
@@ -855,6 +855,9 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
...
@@ -855,6 +855,9 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
/*
/*
Get privilege for a host, user and db combination
Get privilege for a host, user and db combination
as db_is_pattern changes the semantics of comparison,
acl_cache is not used if db_is_pattern is set.
*/
*/
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
bin_ip
,
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
bin_ip
,
...
@@ -875,7 +878,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
...
@@ -875,7 +878,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
db
=
tmp_db
;
db
=
tmp_db
;
}
}
key_length
=
(
uint
)
(
end
-
key
);
key_length
=
(
uint
)
(
end
-
key
);
if
((
entry
=
(
acl_entry
*
)
acl_cache
->
search
(
key
,
key_length
)))
if
(
!
db_is_pattern
&&
(
entry
=
(
acl_entry
*
)
acl_cache
->
search
(
key
,
key_length
)))
{
{
db_access
=
entry
->
access
;
db_access
=
entry
->
access
;
VOID
(
pthread_mutex_unlock
(
&
acl_cache
->
lock
));
VOID
(
pthread_mutex_unlock
(
&
acl_cache
->
lock
));
...
@@ -923,7 +926,8 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
...
@@ -923,7 +926,8 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
}
}
exit:
exit:
/* Save entry in cache for quick retrieval */
/* Save entry in cache for quick retrieval */
if
((
entry
=
(
acl_entry
*
)
malloc
(
sizeof
(
acl_entry
)
+
key_length
)))
if
(
!
db_is_pattern
&&
(
entry
=
(
acl_entry
*
)
malloc
(
sizeof
(
acl_entry
)
+
key_length
)))
{
{
entry
->
access
=
(
db_access
&
host_access
);
entry
->
access
=
(
db_access
&
host_access
);
entry
->
length
=
key_length
;
entry
->
length
=
key_length
;
...
...
sql/sql_parse.cc
View file @
72c9ac84
...
@@ -2727,7 +2727,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
...
@@ -2727,7 +2727,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if
(
!
(
thd
->
master_access
&
SELECT_ACL
)
&&
if
(
!
(
thd
->
master_access
&
SELECT_ACL
)
&&
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
))))
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
))))
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
thd
->
priv_user
,
db
,
0
);
/* purecov: inspected */
thd
->
priv_user
,
db
,
test
(
want_access
&
GRANT_ACL
));
*
save_priv
=
thd
->
master_access
|
db_access
;
*
save_priv
=
thd
->
master_access
|
db_access
;
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
...
@@ -2747,7 +2747,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
...
@@ -2747,7 +2747,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
)))
if
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
)))
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
thd
->
priv_user
,
db
,
0
);
/* purecov: inspected */
thd
->
priv_user
,
db
,
test
(
want_access
&
GRANT_ACL
));
else
else
db_access
=
thd
->
db_access
;
db_access
=
thd
->
db_access
;
// Remove SHOW attribute and access rights we already have
// Remove SHOW attribute and access rights we already have
...
...
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