stdout, stderr redirections lost
Brought to you by:
alsterg
The implementation used to capture output from the NetSNMP library calls for inclusion in the TCL result string has the side-effect of destroying any redirections of stdout and stderr applied to the process using the extension. The code assumes that calling freopen() on /dev/tty for stdout and stderr is sufficient; but this isn't the case if either or both output streams have been redirected prior to calls into the extension code.
The attached patch to tcl-snmptools-1.0/generic/util.c corrects this behavior for platforms that have dup(), dup2(), and fcntl(). I don't know what the equivalent fix on e.g. WIN32 looks like.
patch to preserve output redirections on Unix-like platforms