diff --git a/Netdisco/Changes b/Netdisco/Changes index 314ede5c..1b1ca76e 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -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 diff --git a/Netdisco/lib/App/Netdisco/Util/SNMP.pm b/Netdisco/lib/App/Netdisco/Util/SNMP.pm index 50e8971b..858a3f82 100644 --- a/Netdisco/lib/App/Netdisco/Util/SNMP.pm +++ b/Netdisco/lib/App/Netdisco/Util/SNMP.pm @@ -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} || ''), + ) : ()), + ) : ()), ); }