diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2014-09-02 20:30:05 +0100 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2014-09-02 20:30:05 +0100 |
commit | 3e62229285ce90c6b56eab5f79f1559c4156641d (patch) | |
tree | c9a90bfcc906652068e2fada793911e4a25e3f46 /scripts | |
parent | 7ba1d3672cf9d7d34135ebec447b4a95766457bb (diff) | |
download | vyatta-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 'scripts')
-rwxr-xr-x | scripts/snmp/vyatta-snmp.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index a39b517b..6423db15 100755 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -224,17 +224,17 @@ sub snmp_get_values { $config->setLevel($snmp_level); my $contact = $config->returnValue("contact"); if (defined $contact) { - print "syscontact \"$contact\" \n"; + print "SysContact $contact \n"; } my $description = $config->returnValue("description"); if (defined $description) { - print "sysdescr \"$description\" \n"; + print "SysDescr $description \n"; } my $location = $config->returnValue("location"); if (defined $location) { - print "syslocation \"$location\" \n"; + print "SysLocation $location \n"; } } |