From cbea4bffaf8ee64229db7624d63e47427c43d664 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 5 Feb 2008 16:50:33 -0800 Subject: make sure regex for matching percentage are anchored This fixes problem where 80%x and x12% would be matched. --- .../qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def | 2 +- .../qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def | 2 +- templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def | 2 +- templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def index a82414a..f20191b 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/ceiling/node.def @@ -1,4 +1,4 @@ type: txt help: Set the limit for this class -syntax:expression: exec "[[ \"$VAR(@)\" =~ \"[0-9]+(\.[0-9]*)?%\" ]] || \ +syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" diff --git a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def index 35d7b1d..94fdd42 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/class/node.tag/rate/node.def @@ -1,7 +1,7 @@ type: txt default: "100%" help: Set the base rate for this class -syntax:expression: exec "[[ \"$VAR(@)\" =~ \"[0-9]+(\.[0-9]*)?%\" ]] || \ +syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" comp_help: Allowed values: % Percentage of overall rate (default 100%) diff --git a/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def b/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def index dff4a89..a72de5d 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/default/ceiling/node.def @@ -1,6 +1,6 @@ type: txt help: Set the limit for default traffic default: "100%" -syntax:expression: exec "[[ \"$VAR(@)\" =~ \"[0-9]+(\.[0-9]*)?%\" ]] || \ +syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" diff --git a/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def b/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def index 9463038..b206332 100644 --- a/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def +++ b/templates/qos-policy/traffic-shaper/node.tag/default/rate/node.def @@ -1,7 +1,7 @@ type: txt default: "50%" help: Set the rate for default traffic -syntax:expression: exec "[[ \"$VAR(@)\" =~ \"[0-9]+(\.[0-9]*)?%\" ]] || \ +syntax:expression: exec "[[ \"$VAR(@)\" =~ '^[0-9]+(\.[0-9]*)?%$' ]] || \ /opt/vyatta/sbin/vyatta-qos-util.pl --rate \"$VAR(@)\"" comp_help: Allowed values: % Percentage of overall rate (default 50%) -- cgit v1.2.3