Fix snmpv3 autovivication bug setting priv strings

This commit is contained in:
Oliver Gorwits
2014-01-24 23:54:40 +00:00
parent a0789929b9
commit 16667532a6
2 changed files with 14 additions and 8 deletions

View File

@@ -15,6 +15,7 @@
* [#85] device property in _no/_only fails with error (R. Kerr)
* Also prefer port filter when linking to connected devices
* Fix SQL logic in PortMAC.pm (imperfectus)
* Fix snmpv3 autovivication bug setting priv strings (LT)
2.021001

View File

@@ -218,17 +218,22 @@ sub _mk_info_commargs {
return (Community => $comm->{community})
if exists $comm->{community};
my $seclevel = (exists $comm->{auth} ?
(exists $comm->{priv} ? 'authPriv' : 'authNoPriv' )
: 'noAuthNoPriv');
my $seclevel =
(exists $comm->{auth} ?
(exists $comm->{priv} ? 'authPriv' : 'authNoPriv' )
: 'noAuthNoPriv');
return (
SecName => $comm->{user},
SecName => $comm->{user},
SecLevel => $seclevel,
AuthProto => uc (eval { $comm->{auth}->{proto} } || 'MD5'),
AuthPass => (eval { $comm->{auth}->{pass} } || ''),
PrivProto => uc (eval { $comm->{priv}->{proto} } || 'DES'),
PrivPass => (eval { $comm->{priv}->{pass} } || ''),
( exists $comm->{auth} ? (
AuthProto => uc ($comm->{auth}->{proto} || 'MD5'),
AuthPass => ($comm->{auth}->{pass} || ''),
( exists $comm->{priv} ? (
PrivProto => uc ($comm->{priv}->{proto} || 'DES'),
PrivPass => ($comm->{priv}->{pass} || ''),
) : ()),
) : ()),
);
}