diff options
author | kuriyama <kuriyama@FreeBSD.org> | 2003-12-26 06:44:09 +0800 |
---|---|---|
committer | kuriyama <kuriyama@FreeBSD.org> | 2003-12-26 06:44:09 +0800 |
commit | f4c32061c4272e10e871a22a9c40c8d34ec9ce8a (patch) | |
tree | c9eeff0fc453a27a5a7eeb0199c2b88dc73c9eb1 /net-mgmt/net-snmp-devel | |
parent | 7e049b460035d5ada52dd2a6f26d129d6eca1139 (diff) | |
download | freebsd-ports-gnome-f4c32061c4272e10e871a22a9c40c8d34ec9ce8a.tar.gz freebsd-ports-gnome-f4c32061c4272e10e871a22a9c40c8d34ec9ce8a.tar.zst freebsd-ports-gnome-f4c32061c4272e10e871a22a9c40c8d34ec9ce8a.zip |
Fix parsing when "file <filename>" directive is used in snmpd.conf
without maxfilesize column.
Diffstat (limited to 'net-mgmt/net-snmp-devel')
-rw-r--r-- | net-mgmt/net-snmp-devel/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/net-snmp-devel/files/patch-file.c | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/net-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile index 17ef31072401..0afbfb88bb87 100644 --- a/net-mgmt/net-snmp-devel/Makefile +++ b/net-mgmt/net-snmp-devel/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-mgmt/net-snmp-devel/files/patch-file.c b/net-mgmt/net-snmp-devel/files/patch-file.c new file mode 100644 index 000000000000..94eab370a857 --- /dev/null +++ b/net-mgmt/net-snmp-devel/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); |