summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 09:51:50 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 09:51:50 -0700
commit4d7029e46837ab93500d8c45e26f6df05c02c8f1 (patch)
tree5bb193ea3efbd6988059e94066ef0e49b45da436
parent983c23fdcb8204238220a26a279d718cd6dff821 (diff)
downloadvyatta-cfg-quagga-4d7029e46837ab93500d8c45e26f6df05c02c8f1.tar.gz
vyatta-cfg-quagga-4d7029e46837ab93500d8c45e26f6df05c02c8f1.zip
Use expression to validate VRRP password
Use CLI regex to check VRRP password rather than having to escape out to shell.
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def7
-rw-r--r--templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def7
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def7
-rw-r--r--templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def7
4 files changed, 8 insertions, 20 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
index 07a4efbd..072a2148 100644
--- a/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
+++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
@@ -1,8 +1,5 @@
type: txt
help: Password
-syntax:expression: exec " \
- if [ `echo -n $VAR(@) | wc -c` -gt 8 ]; then \
- echo Password must be 8 characters or less ; \
- exit 1 ; \
- fi ; "
+syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,8}$";
+ "Password must be 8 characters or less"
val_help: Password (8 characters or less)
diff --git a/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def b/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
index 07a4efbd..072a2148 100644
--- a/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
+++ b/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
@@ -1,8 +1,5 @@
type: txt
help: Password
-syntax:expression: exec " \
- if [ `echo -n $VAR(@) | wc -c` -gt 8 ]; then \
- echo Password must be 8 characters or less ; \
- exit 1 ; \
- fi ; "
+syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,8}$";
+ "Password must be 8 characters or less"
val_help: Password (8 characters or less)
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
index 07a4efbd..072a2148 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
@@ -1,8 +1,5 @@
type: txt
help: Password
-syntax:expression: exec " \
- if [ `echo -n $VAR(@) | wc -c` -gt 8 ]; then \
- echo Password must be 8 characters or less ; \
- exit 1 ; \
- fi ; "
+syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,8}$";
+ "Password must be 8 characters or less"
val_help: Password (8 characters or less)
diff --git a/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
index 07a4efbd..072a2148 100644
--- a/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
+++ b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/authentication/password/node.def
@@ -1,8 +1,5 @@
type: txt
help: Password
-syntax:expression: exec " \
- if [ `echo -n $VAR(@) | wc -c` -gt 8 ]; then \
- echo Password must be 8 characters or less ; \
- exit 1 ; \
- fi ; "
+syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,8}$";
+ "Password must be 8 characters or less"
val_help: Password (8 characters or less)