Item #2 on the "5.4.1 open issues" Wiki page turns out to be due a problem
with handling single-line (and zero-line) output.
The following patch fixes the problem, by calculating the length of output
directly. The "lines" index array is then only used when working with
multi-line output.

I'm therefore calling for votes to include this in 5.4.1
Ideally, I'd like to see this added before 5.4.1.rc2, although I
realise that the timescale is a little short.


========= cut here ==============
--- agent/mibgroup/agent/extend.c (revision 16592)
+++ agent/mibgroup/agent/extend.c (working copy)
@@ -1360,7 +1360,7 @@
return ((u_char *) (&long_ret));
case ERRORMSG: /* first line of text returned from
the process */
netsnmp_cache_check_and_reload( exten->exec_entry->cache );
- if (exten->exec_entry->lines) {
+ if (exten->exec_entry->numlines > 1) {
*var_len = (exten->exec_entry->lines[1])-
(exten->exec_entry->output) -1;
} else if (exten->exec_entry->output) {

This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Net-snmp-coders mailing list