SNMP session options in scotty

Robert Premuz (rpremuz@srce.hr)
Sat, 1 Jun 1996 18:23:42 +0200 (MET DST)

Hello,

I'd like to suggest a change in the way the options for configuring an
SNMP session are matched in scotty version 2.0.2 (the options are used
in 'snmp session' and 'snmp# configure' commands).

My understanding of the C code in the scotty-2.0.2/snmp/snmpTcl.c file
tells me that the options checking is broken. It seems the intention
was to allow the options to be abbreviated but, currently, it is not
implemented correctly in many cases because not enough characters are
checked to be sure that an option is abbreviated unambiguously.

For example, if you invoke

scotty% snmp session -

you'll get the following error message:

port number missing

which shows that when the -port option is checked, the length of the
specified option is not taken into account and hence the '-' option
matches the -port option.

To fix the bug, the length of the specified option must be greater
than or equal to the minimal length which unambiguously defines the
option.

But, to simplify the matter, I suggest not allowing the options to be
abbreviated at all (the current man page does not mention such
possibility). This will make the situation very clear and unambiguous
(I don't care for a few more characters in my scripts :)

In this case, the options can be matched in scotty's sources simply by
the following condition (note that strcmp() is used instead of
strncmp()):

if (!strcmp (*argv, "-port"))

Looking forward to your comments.

v
-- rpr. : Robert B. Premuz
Internet: rpremuz@malik.srce.hr * Voice at home: +385 (0)1 687564