summaryrefslogtreecommitdiff
path: root/templates/firewall/group/port-group/node.def
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-24 08:01:59 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-24 08:01:59 -0800
commit853a56308e23724f4e2a9e4067015f59b088e169 (patch)
tree2b36c5bf1489fbdee540e52554530f0fbf565563 /templates/firewall/group/port-group/node.def
parent2dac8cbc810c4d3b743b684ef596bc713af4204b (diff)
downloadvyatta-cfg-firewall-853a56308e23724f4e2a9e4067015f59b088e169.tar.gz
vyatta-cfg-firewall-853a56308e23724f4e2a9e4067015f59b088e169.zip
Use regex to test for name length rather than wc program
More efficient to use shell pattern match to test for name length.
Diffstat (limited to 'templates/firewall/group/port-group/node.def')
-rw-r--r--templates/firewall/group/port-group/node.def10
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/firewall/group/port-group/node.def b/templates/firewall/group/port-group/node.def
index 0500ac1..76fef9e 100644
--- a/templates/firewall/group/port-group/node.def
+++ b/templates/firewall/group/port-group/node.def
@@ -3,11 +3,8 @@ priority: 200
type: txt
help: Firewall port-group
-syntax:expression: exec " \
- if [ `echo $VAR(@) | wc -c` -gt 31 ]; then \
- echo group name must be 31 characters or less;\
- exit 1 ; \
- fi ; "
+syntax:expression: pattern $VAR(@) "^[[:graph:]]{1,31}$" ; \
+ "Firewall group name must be 31 characters or less"
syntax:expression: pattern $VAR(@) "^[^-]" ; \
"Firewall group name cannot start with \"-\""
@@ -15,6 +12,9 @@ syntax:expression: pattern $VAR(@) "^[^-]" ; \
syntax:expression: pattern $VAR(@) "^[^!]" ; \
"Firewall group name cannot start with \"!\""
+syntax:expression: pattern $VAR(@) "^[^|;&$<>]*$" ; \
+ "Firewall group name cannot contain shell punctuation"
+
create: sudo /opt/vyatta/sbin/vyatta-ipset.pl \
--action=create-set \
--set-type=port \