From 4d7029e46837ab93500d8c45e26f6df05c02c8f1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 20 Jul 2010 09:51:50 -0700 Subject: Use expression to validate VRRP password Use CLI regex to check VRRP password rather than having to escape out to shell. --- .../vrrp/vrrp-group/node.tag/authentication/password/node.def | 7 ++----- .../vrrp/vrrp-group/node.tag/authentication/password/node.def | 7 ++----- .../vrrp/vrrp-group/node.tag/authentication/password/node.def | 7 ++----- .../vrrp/vrrp-group/node.tag/authentication/password/node.def | 7 ++----- 4 files changed, 8 insertions(+), 20 deletions(-) (limited to 'templates') 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) -- cgit v1.2.3