summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2014-09-02 20:30:05 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2014-09-02 20:30:05 +0100
commit3e62229285ce90c6b56eab5f79f1559c4156641d (patch)
treec9a90bfcc906652068e2fada793911e4a25e3f46 /templates
parent7ba1d3672cf9d7d34135ebec447b4a95766457bb (diff)
downloadvyatta-cfg-system-3e62229285ce90c6b56eab5f79f1559c4156641d.tar.gz
vyatta-cfg-system-3e62229285ce90c6b56eab5f79f1559c4156641d.zip
vyatta-cfg-system: remove quotes from SysContact and SysLocation
When the values for SysContact, SysLocation and SysDecr are written to the snmpd.conf file, they are enclosed in backslash escaped quotes. This isn't part of the syntax for snmpd.conf and looks wrong / could break snmp related things, the example snmpd.conf files show these values as unquoted. This patch corrects the output and adds validation for the supplied values, limiting them to a maximum of 255 printable characters (RFC 3418). The documentation also needs amending to take this into account. Bug #261 http://bugzilla.vyos.net/show_bug.cgi?id=261
Diffstat (limited to 'templates')
-rw-r--r--templates/service/snmp/contact/node.def4
-rw-r--r--templates/service/snmp/description/node.def4
-rw-r--r--templates/service/snmp/location/node.def3
3 files changed, 11 insertions, 0 deletions
diff --git a/templates/service/snmp/contact/node.def b/templates/service/snmp/contact/node.def
index 039cd548..63a368cc 100644
--- a/templates/service/snmp/contact/node.def
+++ b/templates/service/snmp/contact/node.def
@@ -1,2 +1,6 @@
type: txt
help: Contact information
+
+syntax:expression: pattern $VAR(@) "^[[:print:]]{1,255}$" ; \
+ "Contact information is limited to 255 characters or less"
+
diff --git a/templates/service/snmp/description/node.def b/templates/service/snmp/description/node.def
index 61ec96b6..cd88099a 100644
--- a/templates/service/snmp/description/node.def
+++ b/templates/service/snmp/description/node.def
@@ -1,2 +1,6 @@
type: txt
help: Description information
+
+syntax:expression: pattern $VAR(@) "^[[:print:]]{1,255}$" ; \
+ "Description is limited to 255 characters or less"
+
diff --git a/templates/service/snmp/location/node.def b/templates/service/snmp/location/node.def
index a5b234ea..903b405f 100644
--- a/templates/service/snmp/location/node.def
+++ b/templates/service/snmp/location/node.def
@@ -1,3 +1,6 @@
type: txt
help: Location information
+syntax:expression: pattern $VAR(@) "^[[:print:]]{1,255}$" ; \
+ "Location is limited to 255 characters or less"
+