Fix table methods when defined as an OID which will not completely translate to a fully qualified textual leaf

This commit is contained in:
Eric A. Miller
2018-04-22 00:30:31 -04:00
parent bd85ebc8d6
commit 603345205a
3 changed files with 39 additions and 3 deletions

View File

@@ -4285,7 +4285,10 @@ sub _load_attr {
# the match to make sure we didn't leave the table during getnext
# requests
my ($leaf) = $qual_leaf =~ /::(\w+)$/;
my ($leaf) = $qual_leaf =~ /::(.+)$/;
# If we weren't able to translate, we'll only have an OID
$leaf = $oid unless defined $leaf;
$self->debug()
and print "SNMP::Info::_load_attr $method : $qual_leaf",
@@ -4656,7 +4659,12 @@ sub _validate_autoload_method {
}
# Validate that we have proper access for the operation
my $access = $SNMP::MIB{$oid}{'access'} || '';
my $access = '';
# Prevent autovivification by checking that MIB leaf exists
if (exists $SNMP::MIB{$oid}) {
$access = $SNMP::MIB{$oid}{'access'} || '';
}
# If we were given a fully qualified OID because we don't have the MIB
# file, it will translate above but we won't be able to check access so