Menu

#825 5.4 agent crashes on duplicate exec names

closed
nobody
None
6
2012-11-08
2007-06-27
No

Net-SNMP 5.4 uses different implementation of 'exec' statements in snmpd.conf. Following part of snmpd.conf causes snmpd 5.4 to crash on snmpwalk (snmpd 5.3 works):

exec shelltest /usr/local/bin/tempstat VRM2
exec shelltest /usr/local/bin/tempstat CPU1
exec shelltest /usr/local/bin/tempstat CPU2
exec shelltest /usr/local/bin/tempstat VRM1

-> snmpd prints "duplicate table data attempted to be entered. row exists"

snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.8
-> snmpd crashes

It does not matter what is in the tempstat script, simple "echo hello world" is enough.

It's easy to fix the crash (see patch attached), but why it is not allowed to have multiple 'shelltest' entries in snmpd.conf? It was working OK in net-snmp 5.3.

Discussion

  • Jan Safranek

    Jan Safranek - 2007-06-27

    patch for the crash

     
  • Dave Shield

    Dave Shield - 2007-08-16

    Logged In: YES
    user_id=88893
    Originator: NO

    SVN revisions 16662/3

    I've tweaked the error message slightly, since the triggering
    condition is somewhat more general (though duplicate names
    is certainly the most likely cause).

    The reason for not allowing duplicate names is that the
    new "extend" mechanism uses it as used as an index into
    the various nsExtend* tables. Since it's an index, it
    clearly has to be unique.
    And starting with 5.4, the "exec" directive is now
    handled as a special-case of "extend" (at least by default,
    though it is possible to revert to the previous code).

    I think that we've always assumed that the NAME token would
    be unique anyway - if only to identify which "exec" directive
    was being activated. It's just that nothing has relied on
    this before.

     
  • Dave Shield

    Dave Shield - 2007-08-16

    Logged In: YES
    user_id=88893
    Originator: NO

    Thanks for the patch! It has been applied to the 5.2.x, 5.3.x and 5.4.x code branches and the main development tree, and will appear in future releases of the Net-SNMP package.

     

Log in to post a comment.