Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

COOK-2561: mysql_database_user can't set global grants #32

Merged
merged 1 commit into from

2 participants

@jcam

No description provided.

@jtimberman jtimberman merged commit c9784cf into opscode-cookbooks:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 8, 2013
  1. @jcam
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  libraries/provider_database_mysql_user.rb
View
2  libraries/provider_database_mysql_user.rb
@@ -64,7 +64,7 @@ def action_grant
password = "'#{@new_resource.password}'"
filtered = '[FILTERED]'
end
- grant_statement = "GRANT #{@new_resource.privileges.join(', ')} ON #{@new_resource.database_name ? "`#{@new_resource.database_name}`" : '*'}.#{@new_resource.table ? "`#{@new_resource.table}`" : '*'} TO `#{@new_resource.username}`@`#{@new_resource.host}` IDENTIFIED BY "
+ grant_statement = "GRANT #{@new_resource.privileges.join(', ')} ON #{@new_resource.database_name && @new_resource.database_name != '*' ? "`#{@new_resource.database_name}`" : '*'}.#{@new_resource.table && @new_resource.table != '*' ? "`#{@new_resource.table}`" : '*'} TO `#{@new_resource.username}`@`#{@new_resource.host}` IDENTIFIED BY "
Chef::Log.info("#{@new_resource}: granting access with statement [#{grant_statement}#{filtered}]")
db.query(grant_statement + password)
@new_resource.updated_by_last_action(true)
Something went wrong with that request. Please try again.