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
fe521dc2
Commit
fe521dc2
authored
Oct 18, 2013
by
Vicențiu Ciorbaru
Committed by
Sergei Golubchik
Oct 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented _non recursive_ role specific grants for table/column level privileges
parent
20609373
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
173 additions
and
45 deletions
+173
-45
sql/sql_acl.cc
sql/sql_acl.cc
+156
-44
sql/sql_db.cc
sql/sql_db.cc
+5
-0
sql/sql_parse.cc
sql/sql_parse.cc
+10
-0
sql/table.h
sql/table.h
+2
-1
No files found.
sql/sql_acl.cc
View file @
fe521dc2
This diff is collapsed.
Click to expand it.
sql/sql_db.cc
View file @
fe521dc2
...
@@ -1478,6 +1478,11 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
...
@@ -1478,6 +1478,11 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
sctx
->
priv_user
,
sctx
->
priv_user
,
new_db_file_name
.
str
,
new_db_file_name
.
str
,
FALSE
)
|
sctx
->
master_access
;
FALSE
)
|
sctx
->
master_access
;
if
(
sctx
->
priv_role
)
{
/* include a possible currently set role for access */
db_access
|=
acl_get
(
""
,
""
,
sctx
->
priv_role
,
new_db_file_name
.
str
,
FALSE
);
}
if
(
!
force_switch
&&
if
(
!
force_switch
&&
!
(
db_access
&
DB_ACLS
)
&&
!
(
db_access
&
DB_ACLS
)
&&
...
...
sql/sql_parse.cc
View file @
fe521dc2
...
@@ -5200,8 +5200,12 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
...
@@ -5200,8 +5200,12 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if
(
!
(
sctx
->
master_access
&
SELECT_ACL
))
if
(
!
(
sctx
->
master_access
&
SELECT_ACL
))
{
{
if
(
db
&&
(
!
thd
->
db
||
db_is_pattern
||
strcmp
(
db
,
thd
->
db
)))
if
(
db
&&
(
!
thd
->
db
||
db_is_pattern
||
strcmp
(
db
,
thd
->
db
)))
{
db_access
=
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db
,
db_access
=
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db
,
db_is_pattern
);
db_is_pattern
);
if
(
sctx
->
priv_role
)
db_access
|=
acl_get
(
""
,
""
,
sctx
->
priv_role
,
db
,
db_is_pattern
);
}
else
else
{
{
/* get access for current db */
/* get access for current db */
...
@@ -5245,8 +5249,14 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
...
@@ -5245,8 +5249,14 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
}
}
if
(
db
&&
(
!
thd
->
db
||
db_is_pattern
||
strcmp
(
db
,
thd
->
db
)))
if
(
db
&&
(
!
thd
->
db
||
db_is_pattern
||
strcmp
(
db
,
thd
->
db
)))
{
db_access
=
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db
,
db_access
=
acl_get
(
sctx
->
host
,
sctx
->
ip
,
sctx
->
priv_user
,
db
,
db_is_pattern
);
db_is_pattern
);
if
(
sctx
->
priv_role
)
{
db_access
|=
acl_get
(
""
,
""
,
sctx
->
priv_role
,
db
,
db_is_pattern
);
}
}
else
else
db_access
=
sctx
->
db_access
;
db_access
=
sctx
->
db_access
;
DBUG_PRINT
(
"info"
,(
"db_access: %lu want_access: %lu"
,
DBUG_PRINT
(
"info"
,(
"db_access: %lu want_access: %lu"
,
...
...
sql/table.h
View file @
fe521dc2
...
@@ -251,7 +251,8 @@ typedef struct st_grant_info
...
@@ -251,7 +251,8 @@ typedef struct st_grant_info
@details The version of this copy is found in GRANT_INFO::version.
@details The version of this copy is found in GRANT_INFO::version.
*/
*/
GRANT_TABLE
*
grant_table
;
GRANT_TABLE
*
grant_table_user
;
GRANT_TABLE
*
grant_table_role
;
/**
/**
@brief Used for cache invalidation when caching privilege information.
@brief Used for cache invalidation when caching privilege information.
...
...
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