mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-10-26 05:50:39 -07:00
fix: case when grant options is set with no other user permissions in… (#744)
* fix: case when grant options is set with no other user permissions in mariadb * Create changelog fragment * fix: wrong file name ext * Update changelogs/fragments/fix_user_perms_revoke_grant_option.yml Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> --------- Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
parent
fad6bc7564
commit
1cb9f369d0
2 changed files with 3 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- mysql_user, mysql_role - fix not existent grant when revoking perms on user/role which do not have any other perms than grant option (https://github.com/ansible-collections/community.mysql/issues/664).
|
||||||
|
|
@ -885,7 +885,7 @@ def privileges_revoke(cursor, user, host, db_table, priv, grant_option, maria_ro
|
||||||
cursor.execute(query, (user, host))
|
cursor.execute(query, (user, host))
|
||||||
priv_string = ",".join([p for p in priv if p not in ('GRANT', )])
|
priv_string = ",".join([p for p in priv if p not in ('GRANT', )])
|
||||||
|
|
||||||
if priv_string != "":
|
if priv_string != "" and not (grant_option and priv_string == "USAGE"):
|
||||||
query = ["REVOKE %s ON %s" % (priv_string, db_table)]
|
query = ["REVOKE %s ON %s" % (priv_string, db_table)]
|
||||||
|
|
||||||
if not maria_role:
|
if not maria_role:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue