summaryrefslogtreecommitdiff
path: root/templates/firewall
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-05-13 18:14:30 -0700
committerMohit Mehta <mohit.mehta@vyatta.com>2009-05-13 18:14:30 -0700
commitc11031f7de6382194ba2bbe560c8869a700489d7 (patch)
tree5abea530b2a887f23a5ec5e92908e12814b3f017 /templates/firewall
parent190d4e8306669942d9ad48a0dc9229813e72c9a1 (diff)
downloadvyatta-cfg-firewall-c11031f7de6382194ba2bbe560c8869a700489d7.tar.gz
vyatta-cfg-firewall-c11031f7de6382194ba2bbe560c8869a700489d7.zip
rectify regex check
Diffstat (limited to 'templates/firewall')
-rw-r--r--templates/firewall/ipv6-modify/node.def6
-rw-r--r--templates/firewall/ipv6-name/node.def6
-rw-r--r--templates/firewall/modify/node.def8
-rw-r--r--templates/firewall/name/node.def8
4 files changed, 22 insertions, 6 deletions
diff --git a/templates/firewall/ipv6-modify/node.def b/templates/firewall/ipv6-modify/node.def
index 5b4c8ac..5ad9f1f 100644
--- a/templates/firewall/ipv6-modify/node.def
+++ b/templates/firewall/ipv6-modify/node.def
@@ -12,7 +12,11 @@ syntax:expression: pattern $VAR(@) "^[^-]" ; "Firewall rule set name cannot star
syntax:expression: pattern $VAR(@) "^[^;]*$" ; "Firewall rule set name cannot contain ';'"
-syntax:expression: pattern $VAR(@) "^[^VZONE]" ; "Firewall rule set name cannot start with \"VZONE\""
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '^VZONE'; then
+ echo Firewall rule set name cannot start with 'VZONE'
+ exit 1
+ fi "
end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules ipv6-modify "$VAR(@)" ;
then
diff --git a/templates/firewall/ipv6-name/node.def b/templates/firewall/ipv6-name/node.def
index d60808b..0d3fb79 100644
--- a/templates/firewall/ipv6-name/node.def
+++ b/templates/firewall/ipv6-name/node.def
@@ -12,7 +12,11 @@ syntax:expression: pattern $VAR(@) "^[^-]" ; "Firewall rule set name cannot star
syntax:expression: pattern $VAR(@) "^[^;]*$" ; "Firewall rule set name cannot contain ';'"
-syntax:expression: pattern $VAR(@) "^[^VZONE]" ; "Firewall rule set name cannot start with \"VZONE\""
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '^VZONE'; then
+ echo Firewall rule set name cannot start with 'VZONE'
+ exit 1
+ fi "
end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules ipv6-name "$VAR(@)" ;
then
diff --git a/templates/firewall/modify/node.def b/templates/firewall/modify/node.def
index c9d6dc0..ec5955a 100644
--- a/templates/firewall/modify/node.def
+++ b/templates/firewall/modify/node.def
@@ -10,10 +10,14 @@ syntax:expression: exec " \
syntax:expression: pattern $VAR(@) "^[^-]" ; "Modify rule set name cannot start with \"-\""
-syntax:expression: pattern $VAR(@) "^[^VZONE]" ; "Firewall rule set name cannot start with \"VZONE\""
-
syntax:expression: pattern $VAR(@) "^[^;]*$" ; "Firewall rule set name cannot contain ';'"
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '^VZONE'; then
+ echo Firewall rule set name cannot start with 'VZONE'
+ exit 1
+ fi "
+
end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules modify "$VAR(@)" ;
then
if [ ${COMMIT_ACTION} = 'DELETE' ] ;
diff --git a/templates/firewall/name/node.def b/templates/firewall/name/node.def
index 4bde06a..01dfaf8 100644
--- a/templates/firewall/name/node.def
+++ b/templates/firewall/name/node.def
@@ -10,10 +10,14 @@ syntax:expression: exec " \
syntax:expression: pattern $VAR(@) "^[^-]" ; "Firewall rule set name cannot start with \"-\""
-syntax:expression: pattern $VAR(@) "^[^VZONE]" ; "Firewall rule set name cannot start with \"VZONE\""
-
syntax:expression: pattern $VAR(@) "^[^;]*$" ; "Firewall rule set name cannot contain ';'"
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '^VZONE'; then
+ echo Firewall rule set name cannot start with 'VZONE'
+ exit 1
+ fi "
+
end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules name "$VAR(@)" ;
then
if [ ${COMMIT_ACTION} = 'DELETE' ] ;