snmptrapd_sql needs the sending hostname to be made available to it. To
do so, it asks for the formating string %B, or CHR_PDU_NAME, which
according to a comment will "Try to convert the numerical transport
information into a hostname [...] Otherwise falls back to the numeric
address format."
The
Hi list,
We've been using snmptrapd_sql and noticed a few issues with it.
The first one should be obvious, and I hope the second isn't too contentious.
The third one is the one I'm not sure about - if it should be done another way,
I'm all ears.
-
realloc_format_trap expects the second parameter to be the input
buffer's length, but instead it was sent sizeof(char*). When the
host name was shorter than that, realloc_format_trap would write to
unallocated memory, potentially crashing the daemon.
---
apps/snmptrapd_sql.c | 2 +-
1 file changed
The database name was hardcoded to net_snmp. This patch makes it
possible to configure it to use something else from the command line, or
from a my.cnf file.
---
apps/snmptrapd_sql.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/apps/snmptrapd_sql.c b/apps/snmptrapd_sql.c
index 628c9bf..08