Skip to content

Commit 443ff06

Browse files
committed
Merge pull request #569 from fnerdwq/mysql_grant_revokation
(MODULES-1330) Change order of revokation.
2 parents 86c7fcf + bbbc6cd commit 443ff06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/puppet/provider/mysql_grant/mysql.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,15 @@ def revoke(user, table)
8989
user_string = self.class.cmd_user(user)
9090
table_string = self.class.cmd_table(table)
9191

92-
query = "REVOKE ALL ON #{table_string} FROM #{user_string}"
93-
mysql([defaults_file, '-e', query].compact)
9492
# revoke grant option needs to be a extra query, because
9593
# "REVOKE ALL PRIVILEGES, GRANT OPTION [..]" is only valid mysql syntax
9694
# if no ON clause is used.
95+
# It hast to be executed before "REVOKE ALL [..]" since a GRANT has to
96+
# exist to be executed successfully
9797
query = "REVOKE GRANT OPTION ON #{table_string} FROM #{user_string}"
9898
mysql([defaults_file, '-e', query].compact)
99+
query = "REVOKE ALL ON #{table_string} FROM #{user_string}"
100+
mysql([defaults_file, '-e', query].compact)
99101
end
100102

101103
def destroy

0 commit comments

Comments
 (0)