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
0b519a40
Commit
0b519a40
authored
Sep 24, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
b4e7803a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
24 deletions
+13
-24
sql/sql_acl.cc
sql/sql_acl.cc
+11
-17
sql/sql_class.cc
sql/sql_class.cc
+1
-5
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-2
No files found.
sql/sql_acl.cc
View file @
0b519a40
...
...
@@ -281,8 +281,8 @@ class ACL_ROLE :public ACL_USER_BASE
uint
counter
;
DYNAMIC_ARRAY
parent_grantee
;
// array of backlinks to elements granted
ACL_ROLE
(
ACL_USER
*
user
,
MEM_ROOT
*
mem
);
ACL_ROLE
(
const
char
*
rolename
,
privilege_t
privileges
,
MEM_ROOT
*
mem
);
ACL_ROLE
(
ACL_USER
*
user
);
ACL_ROLE
(
const
char
*
rolename
,
privilege_t
privileges
,
MEM_ROOT
*
mem
);
};
...
...
@@ -2182,7 +2182,7 @@ enum enum_acl_lists
ROLES_MAPPINGS_HASH
};
ACL_ROLE
::
ACL_ROLE
(
ACL_USER
*
user
,
MEM_ROOT
*
root
)
ACL_ROLE
::
ACL_ROLE
(
ACL_USER
*
user
)
:
/* set initial role access the same as the table row privileges */
initial_role_access
(
user
->
access
),
...
...
@@ -2194,9 +2194,8 @@ ACL_ROLE::ACL_ROLE(ACL_USER *user, MEM_ROOT *root)
flags
=
IS_ROLE
;
}
ACL_ROLE
::
ACL_ROLE
(
const
char
*
rolename
,
privilege_t
privileges
,
MEM_ROOT
*
root
)
:
initial_role_access
(
privileges
),
counter
(
0
)
ACL_ROLE
::
ACL_ROLE
(
const
char
*
rolename
,
privilege_t
privileges
,
MEM_ROOT
*
root
)
:
initial_role_access
(
privileges
),
counter
(
0
)
{
this
->
access
=
initial_role_access
;
this
->
user
.
str
=
safe_strdup_root
(
root
,
rolename
);
...
...
@@ -2666,7 +2665,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
continue
;
}
ACL_ROLE
*
entry
=
new
(
&
acl_memroot
)
ACL_ROLE
(
&
user
,
&
acl_memroot
);
ACL_ROLE
*
entry
=
new
(
&
acl_memroot
)
ACL_ROLE
(
&
user
);
entry
->
role_grants
=
user
.
role_grants
;
my_init_dynamic_array
(
key_memory_acl_mem
,
&
entry
->
parent_grantee
,
sizeof
(
ACL_USER_BASE
*
),
0
,
8
,
MYF
(
0
));
...
...
@@ -8518,16 +8517,13 @@ void GRANT_INFO::read(const Security_context *sctx,
grant_table_user
=
grant_table_role
=
grant_public
=
NULL
;
#else
grant_table_user
=
table_hash_search
(
sctx
->
host
,
sctx
->
ip
,
db
,
sctx
->
priv_user
,
table_hash_search
(
sctx
->
host
,
sctx
->
ip
,
db
,
sctx
->
priv_user
,
table
,
FALSE
);
/* purecov: inspected */
grant_table_role
=
sctx
->
priv_role
[
0
]
?
table_hash_search
(
""
,
NULL
,
db
,
sctx
->
priv_role
,
sctx
->
priv_role
[
0
]
?
table_hash_search
(
""
,
NULL
,
db
,
sctx
->
priv_role
,
table
,
TRUE
)
:
NULL
;
grant_public
=
acl_public
?
table_hash_search
(
""
,
NULL
,
db
,
public_name
.
str
,
acl_public
?
table_hash_search
(
""
,
NULL
,
db
,
public_name
.
str
,
table
,
TRUE
)
:
NULL
;
#endif
version
=
grant_version
;
/* purecov: inspected */
...
...
@@ -11211,8 +11207,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
int
rc
;
user_name
=
get_current_user
(
thd
,
tmp_user_name
,
false
);
if
(
!
user_name
||
(
handle_as_role
&&
(
strcasecmp
(
user_name
->
user
.
str
,
public_name
.
str
)
==
0
)))
(
strcasecmp
(
user_name
->
user
.
str
,
public_name
.
str
)
==
0
)))
{
thd
->
clear_error
();
if
(
!
user_name
)
...
...
@@ -13010,8 +13005,7 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock)
return
dup
;
}
role_name_check_result
result
=
check_role_name
(
user
->
user
.
str
,
user
->
host
.
length
==
0
);
role_name_check_result
result
=
check_role_name
(
user
->
user
.
str
,
true
);
if
(
result
==
ROLE_NAME_INVALID
)
return
0
;
if
(
result
==
ROLE_NAME_PUBLIC
)
...
...
sql/sql_class.cc
View file @
0b519a40
...
...
@@ -6024,11 +6024,7 @@ void THD::get_definer(LEX_USER *definer, bool role)
{
binlog_invoker
(
role
);
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
#ifdef WITH_WSREP
if
((
wsrep_applier
||
slave_thread
)
&&
has_invoker
())
#else
if
(
slave_thread
&&
has_invoker
())
#endif
if
((
IF_WSREP
(
wsrep_applier
,
0
)
||
slave_thread
)
&&
has_invoker
())
{
definer
->
user
=
invoker
.
user
;
definer
->
host
=
invoker
.
host
;
...
...
sql/sql_yacc.yy
View file @
0b519a40
...
...
@@ -17156,8 +17156,7 @@ grant_role:
$$->host= empty_clex_str;
if (unlikely(check_string_char_length(&$$->user, ER_USERNAME,
username_char_length,
cs, 0)))
username_char_length, cs, 0)))
MYSQL_YYABORT;
}
| current_role
...
...
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