diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 09:51:50 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 09:51:50 -0700 |
commit | 4d7029e46837ab93500d8c45e26f6df05c02c8f1 (patch) | |
tree | 5bb193ea3efbd6988059e94066ef0e49b45da436 /templates/interfaces/ethernet | |
parent | 983c23fdcb8204238220a26a279d718cd6dff821 (diff) | |
download | vyatta-cfg-system-4d7029e46837ab93500d8c45e26f6df05c02c8f1.tar.gz vyatta-cfg-system-4d7029e46837ab93500d8c45e26f6df05c02c8f1.zip |
Use expression to validate VRRP password
Use CLI regex to check VRRP password rather than having to
escape out to shell.
Diffstat (limited to 'templates/interfaces/ethernet')
2 files changed, 4 insertions, 10 deletions
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) |