From 09f42c8bb3d34ac2b259997801fdb163e805cba1 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Thu, 10 Oct 2013 13:48:24 -0700 Subject: [PATCH] Further improvements to our matching - stop trying to guess what might be the username or hostname and just match the entire thing no matter what it may be. --- lib/puppet/provider/mysql_grant/mysql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/mysql_grant/mysql.rb b/lib/puppet/provider/mysql_grant/mysql.rb index 9d6f3ad..6ef3ba0 100644 --- a/lib/puppet/provider/mysql_grant/mysql.rb +++ b/lib/puppet/provider/mysql_grant/mysql.rb @@ -14,7 +14,7 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys # Match the munges we do in the type. munged_grant = grant.delete("'").delete("`") # Matching: GRANT (SELECT, UPDATE) PRIVILEGES ON (*.*) TO ('root')@('127.0.0.1') (WITH GRANT OPTION) - if match = munged_grant.match(/^GRANT\s(.+)\sON\s(.+)\sTO\s([\w.:]+)@([\w.:\/]+)(\s.*)$/) + if match = munged_grant.match(/^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)$/) privileges, table, user, host, rest = match.captures # Once we split privileges up on the , we need to make sure we # shortern ALL PRIVILEGES to just all.