summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2003-12-25 22:44:09 +0000
committerkuriyama <kuriyama@FreeBSD.org>2003-12-25 22:44:09 +0000
commitf4c32061c4272e10e871a22a9c40c8d34ec9ce8a (patch)
treec9eeff0fc453a27a5a7eeb0199c2b88dc73c9eb1 /net
parent7e049b460035d5ada52dd2a6f26d129d6eca1139 (diff)
downloadFreeBSD-ports-f4c32061c4272e10e871a22a9c40c8d34ec9ce8a.zip
FreeBSD-ports-f4c32061c4272e10e871a22a9c40c8d34ec9ce8a.tar.gz
Fix parsing when "file <filename>" directive is used in snmpd.conf
without maxfilesize column.
Diffstat (limited to 'net')
-rw-r--r--net/net-snmp/Makefile1
-rw-r--r--net/net-snmp/files/patch-file.c24
2 files changed, 25 insertions, 0 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile
index 17ef310..0afbfb8 100644
--- a/net/net-snmp/Makefile
+++ b/net/net-snmp/Makefile
@@ -7,6 +7,7 @@
PORTNAME= net-snmp
PORTVERSION= 5.1
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= net-snmp
diff --git a/net/net-snmp/files/patch-file.c b/net/net-snmp/files/patch-file.c
new file mode 100644
index 0000000..94eab37
--- /dev/null
+++ b/net/net-snmp/files/patch-file.c
@@ -0,0 +1,24 @@
+--- agent/mibgroup/ucd-snmp/file.c.orig Thu Dec 25 23:57:14 2003
++++ agent/mibgroup/ucd-snmp/file.c Thu Dec 25 23:57:37 2003
+@@ -91,17 +91,19 @@
+ file_parse_config(const char *token, char *cptr)
+ {
+ char space;
++ int items;
+
+ if (fileCount < MAXFILE) {
+ fileTable[fileCount].max = -1;
+
+- sscanf(cptr, "%255s%c%d",
++ memset(fileTable[fileCount].name, 0, sizeof(fileTable[0].name));
++ items = sscanf(cptr, "%255s%c%d",
+ fileTable[fileCount].name, &space, &fileTable[fileCount].max);
+ /*
+ * Log an error then return if the string scanned in was larger then
+ * it should have been.
+ */
+- if (space != ' ') {
++ if (items != 1 && space != ' ') {
+ snmp_log(LOG_ERR, "file_parse_config: file name scanned " \
+ "in from line %s is too large. fileCount = %d\n", cptr,
+ fileCount);
OpenPOWER on IntegriCloud