(#10700) allow additional characters in comment string
authorJonathan Boyett <jonathan@failingservers.com>
Thu, 10 Nov 2011 02:55:08 +0000 (18:55 -0800)
committerJonathan Boyett <jonathan@failingservers.com>
Thu, 10 Nov 2011 02:55:08 +0000 (18:55 -0800)
lib/puppet/type/firewall.rb
spec/fixtures/iptables/conversion_hash.rb

index ab86a359bd2c38a3634b920b677dcbd8e4693486..0889268c0f35f149071c4d9742fbe298224508db 100644 (file)
@@ -61,7 +61,7 @@ Puppet::Type.newtype(:firewall) do
     isnamevar
 
     # Keep rule names simple - they must start with a number
-    newvalues(/^\d+[a-zA-Z0-9\s\-_]+$/)
+    newvalues(/^\d+[[:alpha:][:digit:][:punct:][:space:]]+$/)
   end
 
   newproperty(:action) do
index 842f9d9c868fa4f296f8ba51efc759806d50a084..e2807b346d1b09909a4b6acc823895121a84c45e 100644 (file)
@@ -93,6 +93,13 @@ ARGS_TO_HASH = {
       :action => nil,
     },
   },
+  'comment_string_character_validation' => {
+    :line => '-A INPUT -s 192.168.0.1 -m comment --comment "000 allow from 192.168.0.1, please"',
+    :tables => 'filter',
+    :params => {
+      :source => '192.168.0.1',
+    },
+  },
 }
 
 # This hash is for testing converting a hash to an argument line.
@@ -176,4 +183,12 @@ HASH_TO_ARGS = {
     :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "100 states_set_from_array",
       "-m", "state", "--state", "ESTABLISHED,INVALID"],
   },
+  'comment_string_character_validation' => {
+    :params => {
+      :name => "000 allow from 192.168.0.1, please",
+      :table => 'filter',
+      :source => '192.168.0.1'
+    },
+    :args => ['-t', :filter, '-s', '192.168.0.1', '-p', :tcp, '-m', 'comment', '--comment', '000 allow from 192.168.0.1, please'],
+  },
 }