Subject: Re: pkg/19939: net/net-snmp update to 5.0.7
To: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 02/05/2003 21:15:54
A critical bug in net-snmp 5.0.7 prevents snmpset from working
sometimes. The patch to fix this bug is derived directly from the
net-snmp CVS repository.
This is a complete update to the pkgsrc module:
Index: Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/Makefile,v
retrieving revision 1.3
diff -c -r1.3 Makefile
*** Makefile 28 Jan 2003 22:03:53 -0000 1.3
--- Makefile 31 Jan 2003 01:26:20 -0000
***************
*** 1,6 ****
# $NetBSD: Makefile,v 1.3 2003/01/28 22:03:53 jlam Exp $
! DISTNAME= net-snmp-5.0.6
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} \
ftp://ftp.net-smnp.org/pub/sourceforge/net-snmp/
--- 1,6 ----
# $NetBSD: Makefile,v 1.3 2003/01/28 22:03:53 jlam Exp $
! DISTNAME= net-snmp-5.0.7
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} \
ftp://ftp.net-smnp.org/pub/sourceforge/net-snmp/
***************
*** 17,37 ****
NET_SNMP_SYS_CONTACT?= default_user@contact.domain
NET_SNMP_SYS_LOCATION?= defaultlocation
- NET_SNMP_LOGFILE?= /var/log/snmpd.log
NET_SNMP_PERSISTENTDIR?= /var/net-snmp
! NET_SNMP_MIBDIRS?= \$$HOME/.snmp/mibs:${PREFIX}/share/snmp/mibs
USE_BUILDLINK2= yes
USE_PKGINSTALL= yes
USE_LIBTOOL= yes
LIBTOOL_OVERRIDE= ${WRKSRC}/libtool
! .if (${OPSYS} == "NetBSD")
CFLAGS+= -Dnetbsd1
.endif
GNU_CONFIGURE= yes
! CONFIGURE_ARGS+= --enable-shared
.if defined(USE_INET6) && (${USE_INET6} == "YES")
CONFIGURE_ARGS+= --enable-ipv6
.else
--- 17,36 ----
NET_SNMP_SYS_CONTACT?= default_user@contact.domain
NET_SNMP_SYS_LOCATION?= defaultlocation
NET_SNMP_PERSISTENTDIR?= /var/net-snmp
! NET_SNMP_MIBDIRS?= \$$HOME/.snmp/mibs:${PREFIX}/share/snmp/mibs:${PREFIX}/lib/tcl/tnm2.1.10/mibs:/usr/local/share/snmp/mibs:/usr/local/lib/tnm3.0.0/mibs
USE_BUILDLINK2= yes
USE_PKGINSTALL= yes
USE_LIBTOOL= yes
LIBTOOL_OVERRIDE= ${WRKSRC}/libtool
! .if (${OPSYS} == "NetBSD") && empty(CFLAGS:M*-Dnetbsd1*)
CFLAGS+= -Dnetbsd1
.endif
GNU_CONFIGURE= yes
! CONFIGURE_ARGS+= --disable-shared
.if defined(USE_INET6) && (${USE_INET6} == "YES")
CONFIGURE_ARGS+= --enable-ipv6
.else
***************
*** 39,52 ****
.endif
CONFIGURE_ARGS+= --with-defaults
CONFIGURE_ARGS+= --with-libwrap
CONFIGURE_ARGS+= --with-openssl
CONFIGURE_ARGS+= --with-sys-contact="${NET_SNMP_SYS_CONTACT}"
CONFIGURE_ARGS+= --with-sys-location="${NET_SNMP_SYS_LOCATION}"
! CONFIGURE_ARGS+= --with-logfile="${NET_SNMP_LOGFILE}"
CONFIGURE_ARGS+= --with-persistent-directory="${NET_SNMP_PERSISTENTDIR}"
.if !empty(NET_SNMP_MIBDIRS)
CONFIGURE_ARGS+= --with-mibdirs="${NET_SNMP_MIBDIRS}"
.endif
#
# Using "dummy" values is technically not compliant with SNMP specs, but
# otherwise, some tools, e.g. net/tcl-scotty, net/tkined, may ignore results
--- 38,60 ----
.endif
CONFIGURE_ARGS+= --with-defaults
CONFIGURE_ARGS+= --with-libwrap
+ .if defined(NET_SNMP_USE_SSL) && ${NET_SNMP_USE_SSL} == "YES"
CONFIGURE_ARGS+= --with-openssl
+ .endif
CONFIGURE_ARGS+= --with-sys-contact="${NET_SNMP_SYS_CONTACT}"
CONFIGURE_ARGS+= --with-sys-location="${NET_SNMP_SYS_LOCATION}"
! #
! # NOTE: if you specify a logfile then this file will be written to by
! # default and although it can be disabled on the command line, the
! # daemon must be stopped to cycle it properly. Remember rc.d/snmpd
! # will use '-s' to enable standard syslog logging anyway.
! #
! CONFIGURE_ARGS+= --without-logfile
CONFIGURE_ARGS+= --with-persistent-directory="${NET_SNMP_PERSISTENTDIR}"
.if !empty(NET_SNMP_MIBDIRS)
CONFIGURE_ARGS+= --with-mibdirs="${NET_SNMP_MIBDIRS}"
.endif
+ CONFIGURE_ARGS+= --with-mib-modules="smux host"
#
# Using "dummy" values is technically not compliant with SNMP specs, but
# otherwise, some tools, e.g. net/tcl-scotty, net/tkined, may ignore results
***************
*** 59,65 ****
#
CONFIGURE_ARGS+= --enable-ucd-snmp-compatibility
! .if !exists(/usr/bin/lpstat)
CONFIGURE_ENV+= ac_cv_path_LPSTAT_PATH=no
.endif
CONFIGURE_ENV+= PERLPROG="${PERL5}"
--- 67,73 ----
#
CONFIGURE_ARGS+= --enable-ucd-snmp-compatibility
! .if (${OPSYS} == "NetBSD") || !exists(/usr/bin/lpstat)
CONFIGURE_ENV+= ac_cv_path_LPSTAT_PATH=no
.endif
CONFIGURE_ENV+= PERLPROG="${PERL5}"
Index: patches/patch-aa
===================================================================
RCS file: patches/patch-aa
diff -N patches/patch-aa
*** patches/patch-aa 24 Oct 2002 08:29:34 -0000 1.1.1.1
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,15 ****
- $NetBSD: patch-aa,v 1.1.1.1 2002/10/24 08:29:34 jlam Exp $
-
- --- agent/snmp_agent.c.orig Sat Oct 5 16:41:58 2002
- +++ agent/snmp_agent.c
- @@ -69,6 +69,10 @@ SOFTWARE.
- #include <dmalloc.h>
- #endif
-
- +#if HAVE_SYSLOG_H
- +#include <syslog.h>
- +#endif
- +
- #ifdef USE_LIBWRAP
- #include <tcpd.h>
- int allow_severity = LOG_INFO;
--- 0 ----
Index: patches/patch-ZZ
===================================================================
RCS file: patches/patch-ZZ
diff -N patches/patch-ZZ
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- patches/patch-ZZ 6 Feb 2003 02:11:08 -0000
***************
*** 0 ****
--- 1,25 ----
+ Index: snmplib/snmp_api.c
+ ===================================================================
+ RCS file: /cvsroot/net-snmp/net-snmp/snmplib/snmp_api.c,v
+ retrieving revision 5.31
+ retrieving revision 5.32
+ diff -c -r5.31 -r5.32
+ *** snmplib/snmp_api.c 14 Jan 2003 14:14:41 -0000 5.31
+ --- snmplib/snmp_api.c 3 Feb 2003 15:25:57 -0000 5.32
+ ***************
+ *** 6536,6542 ****
+ buf_ptr = value;
+ value_len = strlen(value);
+ }
+ ! if (!_check_range(tp, itmp, &result, "Bad string length"))
+ break;
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OCTET_STR,
+ buf_ptr, value_len);
+ --- 6536,6542 ----
+ buf_ptr = value;
+ value_len = strlen(value);
+ }
+ ! if (!_check_range(tp, value_len, &result, "Bad string length"))
+ break;
+ snmp_pdu_add_variable(pdu, name, name_length, ASN_OCTET_STR,
+ buf_ptr, value_len);
Index: distinfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/distinfo,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 distinfo
*** distinfo 24 Oct 2002 08:29:33 -0000 1.1.1.1
--- distinfo 6 Feb 2003 02:11:19 -0000
***************
*** 1,5 ****
$NetBSD: distinfo,v 1.1.1.1 2002/10/24 08:29:33 jlam Exp $
! SHA1 (net-snmp-5.0.6.tar.gz) = c4aa9e638161014a02bc670fc7d5c09a34024f8c
! Size (net-snmp-5.0.6.tar.gz) = 2209625 bytes
! SHA1 (patch-aa) = 186aeb6c637a3ebe2a0d65d819a4af2bfc4467e9
--- 1,5 ----
$NetBSD: distinfo,v 1.1.1.1 2002/10/24 08:29:33 jlam Exp $
! SHA1 (net-snmp-5.0.7.tar.gz) = 0bd9337a26ffc214d3306590d7142c60a5ac17fc
! Size (net-snmp-5.0.7.tar.gz) = 2253313 bytes
! SHA1 (patch-ZZ) = 40c3c5ac0f86ca9b70bdb36a048d6ffca2d911e2
--
Greg A. Woods
+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>