]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fix extra quotes in firewall string matching
authorIBBoard <github@ibboard.co.uk>
Wed, 23 Sep 2020 19:58:09 +0000 (20:58 +0100)
committerGitHub <noreply@github.com>
Wed, 23 Sep 2020 19:58:09 +0000 (20:58 +0100)
As reported by Steve Traylon[1] and @patricknelson[2], the munging adds extra quotes to the string.
This breaks the string matching in iptables, as it looks for literal single quotes in the match.

Removing the munging fixes this.

[1] https://tickets.puppetlabs.com/browse/MODULES-3454?focusedCommentId=686988&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-686988
[2] https://github.com/puppetlabs/puppetlabs-firewall/commit/3655c6bd33d662a3813c2f66cd0bc5889c68c2c2#diff-379160b60a9bdf297b92a51d20efd8c3R1426

lib/puppet/type/firewall.rb

index 7ac3fdb52f795f5f431357b644e2527e992a5767..2b315a47408e583d9d69df9c6b030457afb032b2 100644 (file)
@@ -2062,10 +2062,6 @@ Puppet::Type.newtype(:firewall) do
       String matching feature. Matches the packet against the pattern
       given as an argument.
     PUPPETCODE
-
-    munge do |value|
-      _value = "'" + value + "'"
-    end
   end
 
   newproperty(:string_hex) do