Add quote to username and host in mysql_grant constructor
The quote is need for username and host in mysql grant. revoke and grant function is already doing it with cmd_user(). not sure why the constructor didn't do it. This patch fixed #261 and #262.
This commit is contained in:
parent
52fb70ebde
commit
58b7dc2c87
1 changed files with 2 additions and 1 deletions
|
@ -6,7 +6,8 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys
|
|||
def self.instances
|
||||
instances = []
|
||||
users.select{ |user| user =~ /.+@/ }.collect do |user|
|
||||
query = "SHOW GRANTS FOR #{user};"
|
||||
user_string = "'#{user.sub('@', "'@'")}'"
|
||||
query = "SHOW GRANTS FOR #{user_string};"
|
||||
grants = mysql([defaults_file, "-NBe", query].compact)
|
||||
# Once we have the list of grants generate entries for each.
|
||||
grants.each_line do |grant|
|
||||
|
|
Loading…
Reference in a new issue