1
0
Fork 0
mirror of https://github.com/ansible-collections/community.mysql.git synced 2026-02-04 07:11:49 +00:00

fix: case when grant options is set with no other user permissions in… (#744) (#750)

* 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



---------


(cherry picked from commit 1cb9f369d0)

Co-authored-by: george2asenov <george.asenov@trafficplanethosting.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
patchback[bot] 2025-10-16 10:01:45 +02:00 committed by GitHub
parent 8445fa13aa
commit 4942fd582c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -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).

View file

@ -886,7 +886,7 @@ def privileges_revoke(cursor, user, host, db_table, priv, grant_option, maria_ro
cursor.execute(query, (user, host))
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)]
if not maria_role: