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
c968a59d
Commit
c968a59d
authored
Oct 17, 2013
by
Vicențiu Ciorbaru
Committed by
Sergei Golubchik
Oct 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a reset_role_grants function specific for roles. The function also
resets the initial role access bits.
parent
aa4657f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
sql/sql_acl.cc
sql/sql_acl.cc
+21
-5
No files found.
sql/sql_acl.cc
View file @
c968a59d
...
@@ -656,7 +656,9 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables);
...
@@ -656,7 +656,9 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables);
static
inline
void
get_grantor
(
THD
*
thd
,
char
*
grantor
);
static
inline
void
get_grantor
(
THD
*
thd
,
char
*
grantor
);
static
my_bool
acl_user_reset_grant
(
ACL_USER
*
user
,
static
my_bool
acl_user_reset_grant
(
ACL_USER
*
user
,
void
*
not_used
__attribute__
((
unused
)));
void
*
not_used
__attribute__
((
unused
)));
static
my_bool
add_role_user_mapping
(
ROLE_GRANT_PAIR
*
entry
);
static
my_bool
acl_role_reset_grant
(
ACL_USER
*
role
,
void
*
not_used
__attribute__
((
unused
)));
static
int
add_role_user_mapping
(
ROLE_GRANT_PAIR
*
mapping
);
/*
/*
Enumeration of various ACL's and Hashes used in handle_grant_struct()
Enumeration of various ACL's and Hashes used in handle_grant_struct()
...
@@ -1295,8 +1297,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
...
@@ -1295,8 +1297,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
}
}
my_hash_insert
(
&
acl_roles_mappings
,
(
uchar
*
)
mapping
);
my_hash_insert
(
&
acl_roles_mappings
,
(
uchar
*
)
mapping
);
}
}
free_root
(
&
temp_root
,
MYF
(
0
));
free_root
(
&
temp_root
,
MYF
(
0
));
end_read_record
(
&
read_record_info
);
end_read_record
(
&
read_record_info
);
...
@@ -2121,10 +2123,24 @@ void rebuild_check_host(void)
...
@@ -2121,10 +2123,24 @@ void rebuild_check_host(void)
}
}
/*
/*
Reset a users role_grants dynamic array.
Reset a role role_grants dynamic array.
Also, the role's access bits are reset to the ones present in the table.
The function can be used as a walk action for hash elements aswell.
*/
my_bool
acl_role_reset_grant
(
ACL_USER
*
role
,
void
*
not_used
__attribute__
((
unused
)))
{
reset_dynamic
(
&
role
->
role_grants
);
/* Also reset the role access bits */
role
->
access
=
role
->
initial_role_access
;
return
0
;
}
The function can is used as a walk action for hash elements aswell.
/*
Reset a users role_grants dynamic array.
The function can be used as a walk action for hash elements aswell.
*/
*/
my_bool
acl_user_reset_grant
(
ACL_USER
*
user
,
my_bool
acl_user_reset_grant
(
ACL_USER
*
user
,
void
*
not_used
__attribute__
((
unused
)))
void
*
not_used
__attribute__
((
unused
)))
...
@@ -2180,7 +2196,7 @@ void rebuild_role_grants(void)
...
@@ -2180,7 +2196,7 @@ void rebuild_role_grants(void)
acl_user_reset_grant
(
user
,
NULL
);
acl_user_reset_grant
(
user
,
NULL
);
}
}
my_hash_iterate
(
&
acl_roles
,
my_hash_iterate
(
&
acl_roles
,
(
my_hash_walk_action
)
acl_
user
_reset_grant
,
NULL
);
(
my_hash_walk_action
)
acl_
role
_reset_grant
,
NULL
);
/*
/*
Rebuild the direct links between users and roles in ACL_USER::role_grants
Rebuild the direct links between users and roles in ACL_USER::role_grants
...
...
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