#1932 "pass" doesn't handle SET requests properly

proxy-override-etc
closed
nobody
agent (1103)
5
2013-01-25
2008-02-13
Dave Shield
No

On the 5.2.x line, the "pass" extension
mechanism doesn't seem to handle SET
requests properly.
The command to invoke is constructed
successfully ("script -s OID type value")
but when script is actually called, it
doesn't see the value parameter.

This mechanism works correctly on the 5.3.x
line and above, which use different code
for invoking the extension script.

See the thread "passing parameters to a
perl script through snmpd" on the users list
(11/12 Feb)

Discussion

  • Logged In: NO

    it's constructed in the code successfully but looses the final argument before the exec? really???

     
  • Dave Shield
    Dave Shield
    2008-02-13

    Logged In: YES
    user_id=88893
    Originator: YES

    Yup.

    If you run snmpd with the option -Dexec
    it will print the command that's being run:

    exec:get_exec_output: calling
    /root/script.pl .1.3.6.1.4.1.2021.255 string hi

    This is basically just a text string.
    The get_exec_output code then tokenizes this string
    into an argv array, and forks off the subprocess.

    I suspect it's this tokenization which is failing.
    The 5.3.x line consolidated several similar chunks
    of code into one routine, which works correctly.
    But we intend to track down and fix the problem in
    the 5.2.x line before the next release.

     
  • Dave Shield
    Dave Shield
    2008-07-28

    Logged In: YES
    user_id=88893
    Originator: YES

    I don't recall what was done to fix this, but the latest 5.2.x code
    (i.e. 5.2.5) appears to work correctly