aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp53
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2005-11-30 05:22:40 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2005-11-30 05:22:40 +0000
commitde310693e85521514938b64185d9b5d6c25cb416 (patch)
tree37d6d3333556dae9186f22cc57a4e3e48783794a /net-mgmt/net-snmp53
parentc695a2d35d62e4c9fa2c7457a90994ca12d59cf1 (diff)
downloadports-de310693e85521514938b64185d9b5d6c25cb416.tar.gz
ports-de310693e85521514938b64185d9b5d6c25cb416.zip
- Upgrade to 5.2.2.
- Return more appropriate values for hrSWRunType (1) PR: ports/86572 (1) Submitted by: wollman (1)
Notes
Notes: svn path=/head/; revision=149996
Diffstat (limited to 'net-mgmt/net-snmp53')
-rw-r--r--net-mgmt/net-snmp53/Makefile8
-rw-r--r--net-mgmt/net-snmp53/distinfo5
-rw-r--r--net-mgmt/net-snmp53/files/extra-patch-local:Makefile.in8
-rw-r--r--net-mgmt/net-snmp53/files/patch-Makefile.in10
-rw-r--r--net-mgmt/net-snmp53/files/patch-asn1.c73
-rw-r--r--net-mgmt/net-snmp53/files/patch-configure.in17
-rw-r--r--net-mgmt/net-snmp53/files/patch-diskio.c12
-rw-r--r--net-mgmt/net-snmp53/files/patch-hr_storage.c41
-rw-r--r--net-mgmt/net-snmp53/files/patch-hr_swrun.c53
-rw-r--r--net-mgmt/net-snmp53/files/patch-local:fixproc168
-rw-r--r--net-mgmt/net-snmp53/files/patch-local:snmpconf72
-rw-r--r--net-mgmt/net-snmp53/files/patch-snmp_agent.c18
-rw-r--r--net-mgmt/net-snmp53/files/test.t12
-rw-r--r--net-mgmt/net-snmp53/pkg-plist5
14 files changed, 133 insertions, 369 deletions
diff --git a/net-mgmt/net-snmp53/Makefile b/net-mgmt/net-snmp53/Makefile
index c612bcd62cd9..d5cab6c70808 100644
--- a/net-mgmt/net-snmp53/Makefile
+++ b/net-mgmt/net-snmp53/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= snmp
-PORTVERSION= 5.2.1.2
+PORTVERSION= 5.2.2
CATEGORIES= net-mgmt ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= net-snmp
@@ -82,7 +82,7 @@ PLIST_SUB+= WITH_IPV6=""
PLIST_SUB+= WITH_IPV6="@comment "
.endif
-SHLIB_VERSION= 7
+SHLIB_VERSION= 9
PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION}
SCRIPTS_SUB= PREFIX=${PREFIX} PERL=${PERL}
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
@@ -165,7 +165,7 @@ MAN5= mib2c.conf.5 snmp.conf.5 snmp_config.5 snmpd.conf.5 \
snmptrapd.conf.5 variables.5
MAN8= snmpd.8 snmptrapd.8
-BIN_FILES= snmpbulkwalk snmpget snmpgetnext snmpnetstat snmpset \
+BIN_FILES= snmpbulkwalk snmpget snmpgetnext snmpnetstat53 snmpset \
snmpstatus snmptest snmptranslate snmptrap snmpwalk
SBIN_FILES= snmpd snmptrapd
STARTUP_DIR= ${PREFIX}/etc/rc.d
@@ -271,6 +271,6 @@ display-message:
# Maintainer's note:
# Don't forget to bump library version in these ports.
-# lang/php4,lang/php5,net-mgmt/braa,net-mgmt/docsis,net/ethereal,net-mgmt/mbrowse,net/quagga,net/tethereal,net-mgmt/zabbix,security/libfwbuilder,net-mgmt/p5-SNMP-Info,net-mgmt/nagios-snmp-plugins,french/plgrenouille,mail/cyrus-imapd22,net/ifstat,sysutils/jailadmin
+# french/plgrenouille,graphics/hpoj,lang/php4,lang/php5,mail/cyrus-imapd22,misc/kdeutils3,net-mgmt/braa,net-mgmt/docsis,net-mgmt/mbrowse,net-mgmt/nagios-snmp-plugins,net-mgmt/p5-SNMP-Info,net-mgmt/py-yapsnmp,net-mgmt/sdig,net-mgmt/zabbix,net/cactid,net/ethereal,net/ifstat,net/quagga,net/rtg,net/tethereal,security/libfwbuilder,sysutils/apcupsd,sysutils/jailadmin,sysutils/nut
.include <bsd.port.post.mk>
diff --git a/net-mgmt/net-snmp53/distinfo b/net-mgmt/net-snmp53/distinfo
index ebd51e9c089e..e3befea5bb8d 100644
--- a/net-mgmt/net-snmp53/distinfo
+++ b/net-mgmt/net-snmp53/distinfo
@@ -1,2 +1,3 @@
-MD5 (net-snmp-5.2.1.2.tar.gz) = 34159770a7fe418d99fdd416a75358b1
-SIZE (net-snmp-5.2.1.2.tar.gz) = 3869893
+MD5 (net-snmp-5.2.2.tar.gz) = 2d9cdf956d6be5c5fcf2f898b403389b
+SHA256 (net-snmp-5.2.2.tar.gz) = ed5cc617e4cfe38af64a3ded8542c4e61d045dbeec00d5b93a31afc3337135fd
+SIZE (net-snmp-5.2.2.tar.gz) = 3919826
diff --git a/net-mgmt/net-snmp53/files/extra-patch-local:Makefile.in b/net-mgmt/net-snmp53/files/extra-patch-local:Makefile.in
index d3da47b8a662..50a941bffa3a 100644
--- a/net-mgmt/net-snmp53/files/extra-patch-local:Makefile.in
+++ b/net-mgmt/net-snmp53/files/extra-patch-local:Makefile.in
@@ -1,9 +1,9 @@
---- local/Makefile.in.orig Fri Sep 17 02:34:58 2004
-+++ local/Makefile.in Mon Oct 25 07:39:24 2004
-@@ -15,7 +15,7 @@
- # local info
+--- local/Makefile.in.orig Tue Oct 11 03:47:48 2005
++++ local/Makefile.in Wed Nov 30 11:32:52 2005
+@@ -16,7 +16,7 @@
#
SNMPCONFPATH=@SNMPCONFPATH@
+ PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
-PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail
+PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail
SHELLSCRIPTS=mib2c-update
diff --git a/net-mgmt/net-snmp53/files/patch-Makefile.in b/net-mgmt/net-snmp53/files/patch-Makefile.in
index 23f4ab131a9a..f5631707a352 100644
--- a/net-mgmt/net-snmp53/files/patch-Makefile.in
+++ b/net-mgmt/net-snmp53/files/patch-Makefile.in
@@ -1,11 +1,11 @@
---- Makefile.in.orig Sun Jul 17 22:43:28 2005
-+++ Makefile.in Sun Jul 17 22:43:33 2005
+--- Makefile.in.orig Tue Oct 11 20:49:23 2005
++++ Makefile.in Wed Nov 30 11:35:12 2005
@@ -16,7 +16,7 @@
INSTALLHEADERS=version.h
INCLUDESUBDIR=system
INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi.h cygwin.h \
-- darwin.h darwin7.h freebsd5.h freebsd6.h \
-+ darwin.h darwin7.h freebsd5.h freebsd6.h freebsd7.h \
+- darwin.h darwin7.h darwin8.h freebsd5.h freebsd6.h \
++ darwin.h darwin7.h darwin8.h freebsd5.h freebsd6.h freebsd7.h \
dynix.h freebsd2.h freebsd3.h freebsd4.h freebsd.h generic.h hpux.h \
irix.h linux.h mingw32.h mips.h netbsd.h openbsd.h osf5.h \
- solaris2.6.h solaris2.7.h solaris2.8.h solaris2.9.h solaris.h \
+ solaris2.6.h solaris2.7.h solaris2.8.h solaris2.9.h solaris2.10.h \
diff --git a/net-mgmt/net-snmp53/files/patch-asn1.c b/net-mgmt/net-snmp53/files/patch-asn1.c
deleted file mode 100644
index e7ec9b103f0b..000000000000
--- a/net-mgmt/net-snmp53/files/patch-asn1.c
+++ /dev/null
@@ -1,73 +0,0 @@
---- snmplib/asn1.c.orig Fri Dec 10 18:07:16 2004
-+++ snmplib/asn1.c Fri Jun 10 20:09:34 2005
-@@ -181,6 +181,9 @@
- #include <in.h>
- #endif
-
-+#if HAVE_UNISTD_H
-+#include <unistd.h>
-+#endif
- #if HAVE_DMALLOC_H
- #include <dmalloc.h>
- #endif
-@@ -584,6 +587,11 @@
- return NULL;
- }
- integer = *intp;
-+ if (intsize > 4) {
-+ register u_long signmask = ((u_long)1 << ((8 * sizeof(long)) - 1));
-+ register u_long signbit = ((integer & signmask) != 0);
-+ integer &= (signbit << 31) | 0x7fffffff;
-+ }
- /*
- * Truncate "unnecessary" bytes off of the most significant end of this
- * 2's complement integer. There should be no sequence of 9
-@@ -663,6 +671,9 @@
- return NULL;
- }
- integer = *intp;
-+ if (intsize > 4) {
-+ integer &= 0xffffffff;
-+ }
- mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));
- /*
- * mask is 0xFF000000 on a big-endian machine
-@@ -2668,19 +2679,26 @@
- register long integer = *intp;
- int testvalue = (*intp < 0) ? -1 : 0;
- size_t start_offset = *offset;
-+ int imaxbytes = 4;
-
- if (intsize != sizeof(long)) {
- _asn_size_err(errpre, intsize, sizeof(long));
- return 0;
- }
-
-+ if (intsize > 4) {
-+ register u_long signmask = ((u_long)1 << ((8 * sizeof(long)) - 1));
-+ register u_long signbit = ((integer & signmask) != 0);
-+ integer &= (signbit << 31) | 0x7fffffff;
-+ }
-+
- if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
- return 0;
- }
- *(*pkt + *pkt_len - (++*offset)) = (u_char) integer;
- integer >>= 8;
-
-- while (integer != testvalue) {
-+ while (integer != testvalue && (--imaxbytes)) {
- if (((*pkt_len - *offset) < 1)
- && !(r && asn_realloc(pkt, pkt_len))) {
- return 0;
-@@ -2823,6 +2841,10 @@
- if (intsize != sizeof(unsigned long)) {
- _asn_size_err(errpre, intsize, sizeof(unsigned long));
- return 0;
-+ }
-+
-+ if (intsize > 4) {
-+ integer &= 0xffffffff;
- }
-
- if (((*pkt_len - *offset) < 1) && !(r && asn_realloc(pkt, pkt_len))) {
diff --git a/net-mgmt/net-snmp53/files/patch-configure.in b/net-mgmt/net-snmp53/files/patch-configure.in
index 99cd2dad2893..172adf21bf2b 100644
--- a/net-mgmt/net-snmp53/files/patch-configure.in
+++ b/net-mgmt/net-snmp53/files/patch-configure.in
@@ -1,6 +1,6 @@
---- configure.in.orig Sat Oct 30 14:05:59 2004
-+++ configure.in Sat Oct 30 15:02:25 2004
-@@ -2071,7 +2071,7 @@
+--- configure.in.orig Tue Nov 29 14:16:55 2005
++++ configure.in Wed Nov 30 11:49:24 2005
+@@ -2075,7 +2075,7 @@
# fall back
CFLAG="-f"
fi
@@ -9,16 +9,7 @@
do
if test -f $i -o $CFLAG $i; then
ac_cv_KERNEL_LOC="$i"
-@@ -2357,7 +2357,7 @@
- AC_HEADER_SYS_WAIT
- AC_CHECK_HEADERS(stdarg.h string.h fcntl.h limits.h sys/file.h sys/ioctl.h syslog.h unistd.h netinet/tcpip.h netinet/in.h netinet/ip.h netinet/ip_icmp.h net/if.h net/if_arp.h netdb.h sys/dmap.h machine/pte.h xti.h sys/sockio.h sys/socket.h sys/un.h fstab.h sys/fs.h mtab.h ufs/fs.h ufs/ffs/fs.h sys/fixpoint.h machine/param.h sys/vm.h vm/vm.h sys/vmmeter.h sys/vmparam.h sys/vmmac.h sys/vmsystm.h sys/mbuf.h sys/time.h sys/times.h sys/swap.h inet/mib2.h sys/statvfs.h sys/vfs.h sys/mnttab.h sys/user.h sys/proc.h sys/select.h mntent.h sys/mntent.h kstat.h utsname.h sys/utsname.h sys/cdefs.h getopt.h locale.h pthread.h sys/loadavg.h regex.h linux/tasks.h pwd.h grp.h utmpx.h)
- # FreeBSD required headers
--AC_CHECK_HEADERS(malloc.h sys/param.h net/if_dl.h sys/sysctl.h stdlib.h net/if_mib.h net/if_types.h net/if_var.h sys/queue.h osreldate.h machine/types.h sys/socketvar.h)
-+AC_CHECK_HEADERS(malloc.h sys/param.h net/if_dl.h sys/sysctl.h stdlib.h net/if_mib.h net/if_types.h net/if_var.h sys/queue.h osreldate.h sys/socketvar.h)
- # Linux
- AC_CHECK_HEADERS(sys/conf.h netinet/in_systm.h netinet/tcp.h netinet/udp.h netinet/in_var.h netinet/if_ether.h netinet/ip_var.h netinet/tcp_timer.h netinet/tcp_var.h netinet/tcp_fsm.h netinet/udp_var.h netinet/icmp_var.h sys/protosw.h nlist.h ioctls.h asm/page.h netipx/ipx.h)
- # NetBSD required headers
-@@ -2811,6 +2811,26 @@
+@@ -2989,6 +2989,26 @@
# checking for 4.3 vs 4.4 rtentry.
AC_CACHE_CHECK(type of rtentry structure,ac_cv_RTENTRY_TYPE,
[
diff --git a/net-mgmt/net-snmp53/files/patch-diskio.c b/net-mgmt/net-snmp53/files/patch-diskio.c
deleted file mode 100644
index 309f0a9d1a04..000000000000
--- a/net-mgmt/net-snmp53/files/patch-diskio.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- ./agent/mibgroup/ucd-snmp/diskio.c.orig Mon Jan 24 23:35:53 2005
-+++ ./agent/mibgroup/ucd-snmp/diskio.c Mon Jan 24 23:37:24 2005
-@@ -458,8 +458,8 @@
- ERROR_MSG("Memory alloc failure - devla_getstats()\n");
- return;
- }
-+ memset(lastat->dinfo, 0, sizeof(struct devinfo));
- }
-- memset(lastat->dinfo, 0, sizeof(struct devinfo));
-
- if ((GETDEVS(lastat)) == -1) {
- ERROR_MSG("can't do getdevs()\n");
diff --git a/net-mgmt/net-snmp53/files/patch-hr_storage.c b/net-mgmt/net-snmp53/files/patch-hr_storage.c
index 3fe873c4eaac..ef250fa6540e 100644
--- a/net-mgmt/net-snmp53/files/patch-hr_storage.c
+++ b/net-mgmt/net-snmp53/files/patch-hr_storage.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/host/hr_storage.c.orig Sun Oct 17 10:59:14 2004
-+++ agent/mibgroup/host/hr_storage.c Mon Oct 25 07:49:40 2004
-@@ -212,6 +212,10 @@
+--- agent/mibgroup/host/hr_storage.c.orig Fri Oct 7 07:55:23 2005
++++ agent/mibgroup/host/hr_storage.c Wed Nov 30 12:01:05 2005
+@@ -233,6 +233,10 @@
void sol_get_swapinfo(int *, int *);
#endif
@@ -11,7 +11,7 @@
#define HRSTORE_MEMSIZE 1
#define HRSTORE_INDEX 2
#define HRSTORE_TYPE 3
-@@ -451,7 +455,8 @@
+@@ -472,7 +476,8 @@
NULL,
"Memory Buffers", /* HRS_TYPE_MBUF */
"Real Memory", /* HRS_TYPE_MEM */
@@ -21,7 +21,7 @@
};
-@@ -566,6 +571,7 @@
+@@ -611,6 +616,7 @@
storage_type_id[storage_type_len - 1] = 3; /* Virtual Mem */
break;
case HRS_TYPE_MBUF:
@@ -29,28 +29,19 @@
storage_type_id[storage_type_len - 1] = 1; /* Other */
break;
default:
-@@ -654,7 +660,7 @@
- case HRS_TYPE_SWAP:
+@@ -704,7 +710,7 @@
long_return = memory_totals.t_vm;
+ #endif
break;
-#else /* !linux && !solaris2 && !hpux10 && !hpux11 && ... */
+#else
case HRS_TYPE_MEM:
long_return = physmem;
break;
-@@ -664,6 +670,8 @@
- #endif
- long_return = 0;
- break;
-+#endif /* linux || solaris2 || hpux10 || hpux11 || ... */
-+#if !defined(linux) && !defined(solaris2) && !defined(hpux10) && !defined(hpux11)
- case HRS_TYPE_MBUF:
- #if HAVE_SYS_POOL_H
- long_return = 0;
-@@ -673,7 +681,26 @@
+@@ -726,13 +732,45 @@
i++)
long_return += mbstat.m_mtypes[i];
- #elif defined(MBSTAT_SYMBOL)
+ #elif defined(MBSTAT_SYMBOL) && defined(STRUCT_MBSTAT_HAS_M_MBUFS)
+#if !defined(__FreeBSD__) || __FreeBSD_version < 500021
long_return = mbstat.m_mbufs;
+#elif defined(__FreeBSD__) && __FreeBSD_version < 500024
@@ -68,16 +59,16 @@
+ break;
+ }
+#else
++#error "XXX"
+ /* XXX TODO: implement new method */
+ return NULL;
+#endif /* __FreeBSD__ */
#elif defined(NO_DUMMY_VALUES)
goto try_next;
#else
-@@ -681,6 +708,18 @@
+ long_return = 0;
#endif
break;
- #endif /* !linux && !solaris2 && !hpux10 && !hpux11 && ... */
+#if defined(__FreeBSD__) && __FreeBSD_version >= 500024
+ case HRS_TYPE_MBUFCLUSTER: {
+ size_t mlen = sizeof(int);
@@ -93,8 +84,8 @@
default:
#if NO_DUMMY_VALUES
goto try_next;
-@@ -733,6 +772,12 @@
- * mclpool.pr_size;
+@@ -796,6 +834,12 @@
+ #endif
#elif defined(MBSTAT_SYMBOL) && defined(STRUCT_MBSTAT_HAS_M_CLUSTERS)
long_return = mbstat.m_clusters - mbstat.m_clfree; /* unlikely, but... */
+#elif defined(__FreeBSD__) && __FreeBSD_version < 500102
@@ -106,7 +97,7 @@
#elif defined(NO_DUMMY_VALUES)
goto try_next;
#else
-@@ -740,6 +785,11 @@
+@@ -803,6 +847,11 @@
#endif
break;
#endif /* !linux && !solaris2 && !hpux10 && !hpux11 && ... */
@@ -118,7 +109,7 @@
default:
#if NO_DUMMY_VALUES
goto try_next;
-@@ -766,7 +816,11 @@
+@@ -829,7 +878,11 @@
break;
#if !defined(linux) && !defined(solaris2) && !defined(hpux10) && !defined(hpux11) && defined(MBSTAT_SYMBOL)
case HRS_TYPE_MBUF:
@@ -130,7 +121,7 @@
break;
#endif /* !linux && !solaris2 && !hpux10 && !hpux11 && MBSTAT_SYMBOL */
default:
-@@ -892,3 +946,97 @@
+@@ -955,3 +1008,97 @@
*usedP = ainfo.ani_resv;
}
#endif /* solaris2 */
diff --git a/net-mgmt/net-snmp53/files/patch-hr_swrun.c b/net-mgmt/net-snmp53/files/patch-hr_swrun.c
index 3bd1e7800e7b..8f709c2f9a2a 100644
--- a/net-mgmt/net-snmp53/files/patch-hr_swrun.c
+++ b/net-mgmt/net-snmp53/files/patch-hr_swrun.c
@@ -1,5 +1,5 @@
---- agent/mibgroup/host/hr_swrun.c.orig Wed Jun 9 05:56:03 2004
-+++ agent/mibgroup/host/hr_swrun.c Fri Jun 25 10:56:38 2004
+--- agent/mibgroup/host/hr_swrun.c.orig Thu Oct 20 04:32:20 2005
++++ agent/mibgroup/host/hr_swrun.c Wed Nov 30 12:50:12 2005
@@ -585,7 +585,7 @@
string[ sizeof(string)-1 ] = 0;
#endif
@@ -9,7 +9,7 @@
strcpy(string, proc_table[LowProcIndex].ki_comm);
#else
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
-@@ -694,7 +694,7 @@
+@@ -698,7 +698,7 @@
*cp1 = 0;
#endif
#elif HAVE_KVM_GETPROCS
@@ -18,7 +18,32 @@
strcpy(string, proc_table[LowProcIndex].ki_comm);
#else
strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
-@@ -889,7 +889,7 @@
+@@ -868,8 +868,23 @@
+ if (pid < PID_MAXSYS)
+ long_return = 2; /* operatingSystem */
+ else
+-#endif
+ long_return = 4; /* application */
++#elif HAVE_KVM_GETPROCS
++ #if defined(freebsd5) && __FreeBSD_version >= 500014
++ if (proc_table[LowProcIndex].ki_flag & P_SYSTEM) {
++ if (proc_table[LowProcIndex].ki_pri.pri_class == PRI_ITHD)
++ long_return = 3;/* deviceDriver */
++ else
++ long_return = 2;/* operatingSystem */
++ } else
++ long_return = 4; /* application */
++#else
++ if (proc_table[LowProcIndex].kp_proc.p_flag & P_SYSTEM)
++ long_return = 2; /* operatingSystem */
++ else
++ long_return = 4; /* application */
++#endif
++#endif
+ return (u_char *) & long_return;
+ case HRSWRUN_STATUS:
+ #if defined(cygwin)
+@@ -901,7 +916,7 @@
}
#else
#if HAVE_KVM_GETPROCS
@@ -27,7 +52,7 @@
switch (proc_table[LowProcIndex].ki_stat) {
#else
switch (proc_table[LowProcIndex].kp_proc.p_stat) {
-@@ -988,7 +988,13 @@
+@@ -1000,7 +1015,13 @@
long_return = proc_buf->p_utime * 100 + proc_buf->p_stime * 100;
#endif
#elif HAVE_KVM_GETPROCS
@@ -42,23 +67,7 @@
long_return = proc_table[LowProcIndex].ki_runtime / 100000;
#else
long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
-@@ -1063,7 +1069,14 @@
- long_return = proc_buf->p_swrss;
- #endif
- #elif HAVE_KVM_GETPROCS
--#if defined(freebsd3) && !defined(darwin)
-+#if defined(freebsd5) && __FreeBSD_version >= 500014
-+ /* XXX
-+ long_return = proc_table[LowProcIndex].ki_vmspace->vm_tsize +
-+ proc_table[LowProcIndex].ki_vmspace->vm_ssize +
-+ proc_table[LowProcIndex].ki_vmspace->vm_dsize;
-+ long_return = long_return * (getpagesize() / 1024); */
-+ long_return = 0;
-+#elif defined(freebsd3) && !defined(darwin)
- long_return =
- #if defined(freebsd5)
- proc_table[LowProcIndex].ki_size / 1024;
-@@ -1349,7 +1362,7 @@
+@@ -1365,7 +1386,7 @@
#elif defined(solaris2)
return proc_table[current_proc_entry++];
#elif HAVE_KVM_GETPROCS
diff --git a/net-mgmt/net-snmp53/files/patch-local:fixproc b/net-mgmt/net-snmp53/files/patch-local:fixproc
index 4fa37283c36f..fa0f3fb65767 100644
--- a/net-mgmt/net-snmp53/files/patch-local:fixproc
+++ b/net-mgmt/net-snmp53/files/patch-local:fixproc
@@ -1,23 +1,21 @@
---- local/fixproc.orig Sat Apr 20 16:30:13 2002
-+++ local/fixproc Wed Jul 13 08:53:37 2005
+--- local/fixproc.orig Wed May 25 01:23:54 2005
++++ local/fixproc Wed Nov 30 12:16:05 2005
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!%%PERL%%
#
# fixproc [-min n] [-max n] [-check | -kill | -restart | -exist | -fix] proc ...
#
-@@ -129,7 +129,9 @@
- #
- # Timothy Kong 3/1995
+@@ -131,7 +131,7 @@
+
+ use File::Temp qw(tempfile);
-$database_file = '/local/etc/fixproc.conf';
-+use File::Temp qw(tempfile);
-+
+$database_file = '%%PREFIX%%/etc/fixproc.conf';
$debug = 0; # specify debug level using -dN
# currently defined: -d1
-@@ -155,6 +157,14 @@
+@@ -157,6 +157,14 @@
$shell_header = "#!/bin/sh\n";
$shell_end_marker = 'shell_end_marker';
@@ -32,122 +30,14 @@
&read_args();
&read_database();
# &dump_database(); # debug only
-@@ -191,20 +201,19 @@
- sub create_sh_script
- {
- local ($file) = pop (@_);
-+ local ($fh) = pop (@_);
- local ($i) = pop (@_);
-
-- printf (stderr "create_sh_script\n") if ($debug > 0);
-+ printf (STDERR "create_sh_script\n") if ($debug > 0);
-
- $! = $fixproc_error;
-- open (file, ">"."$file") || die "$0: cannot open $file\n";
- while ( $shell_lines[$i] ne $shell_end_marker )
- {
-- printf (file "%s", $shell_lines[$i]);
-+ printf ($fh "%s", $shell_lines[$i]);
- $i++;
- }
-- close (file);
-- system "chmod +x $file";
-- return file;
-+ close ($fh);
-+ chmod 0755, $file;
- }
-
-
-@@ -212,7 +221,7 @@
- {
- local ($proc) = pop(@_);
-
-- printf (stderr "do_fix\n") if ($debug > 0);
-+ printf (STDERR "do_fix\n") if ($debug > 0);
-
- if ($fix{$proc} eq '')
- {
-@@ -230,15 +239,14 @@
- else
- {
- # it must be "shell", so execute the shell script defined in database
-+ local ($tmpfh, $tmpfile) = tempfile("fix_XXXXXXXX", DIR => "/tmp");
-
-- local ($tmpfile) = "/tmp/fix_$$";
--
-- &create_sh_script ($fix{$proc}, $tmpfile);
-+ &create_sh_script ($fix{$proc}, $tmpfh, $tmpfile);
-
- # return code is number divided by 256
- $error_code = (system "$tmpfile") / 256;
-- system "rm $tmpfile";
-- return ($fix_failed_error) if ($error_code != 0);
-+ unlink($tmpfile);
-+ return ($cannot_fix_error) if ($error_code != 0);
- # sleep needed here?
- return &do_exist ($proc);
- }
-@@ -249,7 +257,7 @@
- {
- local ($proc) = pop(@_);
-
-- printf (stderr "do_check\n") if ($debug > 0);
-+ printf (STDERR "do_check\n") if ($debug > 0);
-
- if ($check{$proc} eq '')
- {
-@@ -262,13 +270,13 @@
- # if not "exist", then it must be "shell", so execute the shell script
- # defined in database
-
-- local ($tmpfile) = "/tmp/check_$$";
-+ local ($tmpfh, $tmpfile) = tempfile("check_XXXXXXXX", DIR => "/tmp");
-
-- &create_sh_script ($check{$proc}, $tmpfile);
-+ &create_sh_script ($fix{$proc}, $tmpfh, $tmpfile);
-
- # return code is number divided by 256
- $error_code = (system "$tmpfile") / 256;
-- system "rm $tmpfile";
-+ unlink($tmpfile);
- return ($check_failed_error) if ($error_code != 0);
-
- # check passed, continue
-@@ -281,14 +289,16 @@
- {
- local ($proc) = pop(@_);
-
-- printf (stderr "do_exist\n") if ($debug > 0);
-+ printf (STDERR "do_exist\n") if ($debug > 0);
-
- # do ps, check to see if min <= no. of processes <= max
- $! = $fixproc_error;
-- open (command, "/bin/ps -e | /bin/grep $proc | /bin/wc -l |")
-+ open (COMMAND, "/bin/ps $ps_opts |")
- || die "$0: can't run ps-grep-wc command\n";
-- $proc_count = <command>;
-- if (($proc_count < $min{$proc}) || ($proc_count > $max{$proc}))
-+ @allprocs = <COMMAND>;
-+ close COMMAND;
-+ @procs = grep(/$proc/, @allprocs);
-+ if (($#procs < $min{$proc}) || ($#procs > $max{$proc}))
- {
- return $check_failed_error;
- }
-@@ -301,45 +311,52 @@
- local ($proc) = pop(@_);
- local ($second_kill_needed);
-
-- printf (stderr "do_kill\n") if ($debug > 0);
-+ printf (STDERR "do_kill\n") if ($debug > 0);
+@@ -305,41 +313,47 @@
# first try kill
$! = $fixproc_error;
-- open (command, "/bin/ps -e | /bin/grep $proc |")
+- open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ open (COMMAND, "/bin/ps $ps_opts |")
|| die "$0: can't run ps-grep-awk command\n";
-- while (<command>)
-+ while (<COMMAND>)
+ while (<COMMAND>)
{
- # match the first field of ps -e
+ if /$proc/ {
@@ -164,12 +54,11 @@
# if process still exist, try kill -9
sleep 2;
$! = $fixproc_error;
-- open (command, "/bin/ps -e | /bin/grep $proc |")
+- open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ open (COMMAND, "/bin/ps $ps_opts |")
|| die "$0: can't run ps-grep-awk command\n";
$second_kill_needed = 0;
-- while (<command>)
-+ while (<COMMAND>)
+ while (<COMMAND>)
{
- # match the first field of ps -e
+ if /$proc/ {
@@ -180,7 +69,6 @@
+ /^\s*(\d+)\s/ || die "$0: can't match ps $ps_opts output\n";
+ kill 9, $1;
$second_kill_needed = 1;
-+ }
}
+ close COMMAND;
return ($no_error) if ($second_kill_needed == 0);
@@ -188,11 +76,10 @@
# see if kill -9 worked
sleep 2;
$! = $fixproc_error;
-- open (command, "/bin/ps -e | /bin/grep $proc |")
+- open (COMMAND, "/bin/ps -e | /bin/grep $proc |")
+ open (COMMAND, "/bin/ps $ps_opts |")
|| die "$0: can't run ps-grep-awk command\n";
-- while (<command>)
-+ while (<COMMAND>)
+ while (<COMMAND>)
{ # a process still exist, return error
- return $cannot_kill_error;
+ return $cannot_kill_error if /$proc/;
@@ -201,32 +88,3 @@
return $no_error; # good, all dead
}
-@@ -349,7 +366,7 @@
- local ($proc) = pop(@_);
- local ($error_code);
-
-- printf (stderr "do_restart\n") if ($debug > 0);
-+ printf (STDERR "do_restart\n") if ($debug > 0);
-
- $error_code = &do_kill ($proc);
- return $error_code if ($error_code != $no_error);
-@@ -369,7 +386,7 @@
- local ($proc) = pop(@_);
- local ($error_code);
-
-- printf (stderr "work_on_proc\n") if ($debug > 0);
-+ printf (STDERR "work_on_proc\n") if ($debug > 0);
-
- if ($cmd_line_action eq '')
- {
-@@ -475,8 +492,8 @@
- local ($str2);
-
- $! = $fixproc_error;
-- open (db, $database_file) || die 'cannot open database file $database_file\n';
-- while (<db>)
-+ open (DB, $database_file) || die 'cannot open database file $database_file\n';
-+ while (<DB>)
- {
- if ((! /\S/) || (/^[ \t]*#.*$/))
- {
diff --git a/net-mgmt/net-snmp53/files/patch-local:snmpconf b/net-mgmt/net-snmp53/files/patch-local:snmpconf
index 5b3623782df9..f2a0b11cf75e 100644
--- a/net-mgmt/net-snmp53/files/patch-local:snmpconf
+++ b/net-mgmt/net-snmp53/files/patch-local:snmpconf
@@ -1,53 +1,35 @@
---- local/snmpconf.orig Sat Oct 9 01:01:37 2004
-+++ local/snmpconf Mon Oct 25 08:42:23 2004
+--- local/snmpconf.orig Sun Aug 21 10:23:23 2005
++++ local/snmpconf Wed Nov 30 12:19:42 2005
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!%%PERL%% -w
#
# A simple configuration file builder based on questions listed in
-@@ -32,7 +32,7 @@
- $opts{'c'} = "$ENV{SNMPSHAREPATH}/snmpconf-data";
- }
- else {
-- $opts{'c'} = "/usr/local/share/snmp/snmpconf-data";
-+ $opts{'c'} = "%%PREFIX%%/share/snmp/snmpconf-data";
- }
-
- # default config file path
-@@ -40,7 +40,7 @@
- $confpath = "$ENV{SNMPCONFPATH}";
- }
- else {
-- $confpath = "/usr/local/share/snmp";
-+ $confpath = "%%PREFIX%%/share/snmp";
- }
+@@ -31,7 +31,7 @@
+ $opts{'c'} = &my_getenv("SNMPSHAREPATH") . "/snmpconf-data";
}
- else
-@@ -128,7 +128,7 @@
- #
- # Find existing files to possibly read in.
- #
--my @searchpath = ("$confpath","/usr/local/etc/snmp", ".", "$home");
-+my @searchpath = ("$confpath","%%PREFIX%%/etc/snmp", ".", "$home");
- push @searchpath, $opts{I} if ($opts{I});
- foreach my $i (@searchpath) {
- debug("searching $i\n");
-@@ -227,7 +227,7 @@
- if ($opts{'i'} || $opts{'I'}) {
- $opts{'I'} = "$confpath" if (!$opts{'I'});
+ else {
+- $opts{'c'} = "/usr/local/share/snmp/snmpconf-data";
++ $opts{'c'} = "%%PREFIX%%/share/snmp/snmpconf-data";
+ }
+
+ # default config file path
+@@ -39,7 +39,7 @@
+ $confpath = &my_getenv("SNMPCONFPATH");
+ }
+ else {
+- $confpath = "/usr/local/share/snmp";
++ $confpath = "%%PREFIX%%/share/snmp";
+ }
+
+ # home environment variable
+@@ -100,7 +100,7 @@
+ $ENV_SEPARATOR = ';';
+ }
+ my @searchpath = split(/$ENV_SEPARATOR/, $confpath);
+-push @searchpath, "/usr/local/etc/snmp";
++push @searchpath, "%%PREFIX%%/etc/snmp";
+ push @searchpath, ".";
+ push @searchpath, "$home";
-- if (! (-d "$opts{'I'}") && ! (mkdir ("$opts{'I'}"))) {
-+ if (! (-d "$opts{'I'}") && ! (mkdir ("$opts{'I'}", 0777))) {
- print "\nCould not create $opts{'I'} directory: $!\n";
- print ("File $didfile{$i} left in current directory\n");
- }
-@@ -242,7 +242,7 @@
- }
- }
- } elsif ($opts{'p'}) {
-- if (! (-d "$home") && ! (mkdir ("$home"))) {
-+ if (! (-d "$home") && ! (mkdir ("$home", 0777))) {
- print "\nCould not create $home directory: $!\n";
- print ("File $didfile{$i} left in current directory\n");
- }
diff --git a/net-mgmt/net-snmp53/files/patch-snmp_agent.c b/net-mgmt/net-snmp53/files/patch-snmp_agent.c
index 735b7fbbc753..a663a5576c56 100644
--- a/net-mgmt/net-snmp53/files/patch-snmp_agent.c
+++ b/net-mgmt/net-snmp53/files/patch-snmp_agent.c
@@ -1,10 +1,10 @@
---- agent/snmp_agent.c.orig Tue Mar 22 11:11:51 2005
-+++ agent/snmp_agent.c Tue Mar 22 11:12:29 2005
-@@ -825,6 +825,7 @@
- return 0;
- }
- } else {
-+ SNMP_FREE(addr_string);
- if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
- snmp_log(allow_severity, "Connection from <UNKNOWN>\n");
+--- agent/snmp_agent.c.orig Thu Mar 17 17:17:43 2005
++++ agent/snmp_agent.c Wed Nov 30 12:23:41 2005
+@@ -839,6 +839,7 @@
+ ;
+ else if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
+ snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string);
++ SNMP_FREE(addr_string);
addr_string = strdup("<UNKNOWN>");
+ } else {
+ snmp_log(deny_severity, "Connection from <UNKNOWN> (%s) REFUSED\n", addr_string);
diff --git a/net-mgmt/net-snmp53/files/test.t b/net-mgmt/net-snmp53/files/test.t
new file mode 100644
index 000000000000..cca9d9ed4191
--- /dev/null
+++ b/net-mgmt/net-snmp53/files/test.t
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -w
+#
+# $FreeBSD$
+
+use strict;
+use Test::More tests => 1;
+
+my $cmd = 'snmpwalk -c public -v 1 localhost';
+
+# ports/86572
+my $output = `$cmd hrSWRunType`;
+like($output, qr/operatingSystem/, 'hrSWRunType');
diff --git a/net-mgmt/net-snmp53/pkg-plist b/net-mgmt/net-snmp53/pkg-plist
index 9846b2dd042c..48a1d50bf3cb 100644
--- a/net-mgmt/net-snmp53/pkg-plist
+++ b/net-mgmt/net-snmp53/pkg-plist
@@ -14,6 +14,7 @@ bin/snmpget
bin/snmpgetnext
bin/snmpinform
bin/snmpnetstat
+bin/snmpnetstat53
bin/snmpset
bin/snmpstatus
bin/snmptable
@@ -140,6 +141,7 @@ include/net-snmp/system/bsdi4.h
include/net-snmp/system/cygwin.h
include/net-snmp/system/darwin.h
include/net-snmp/system/darwin7.h
+include/net-snmp/system/darwin8.h
include/net-snmp/system/dynix.h
include/net-snmp/system/freebsd.h
include/net-snmp/system/freebsd2.h
@@ -162,6 +164,7 @@ include/net-snmp/system/solaris2.6.h
include/net-snmp/system/solaris2.7.h
include/net-snmp/system/solaris2.8.h
include/net-snmp/system/solaris2.9.h
+include/net-snmp/system/solaris2.10.h
include/net-snmp/system/sunos.h
include/net-snmp/system/svr5.h
include/net-snmp/system/sysv.h
@@ -243,6 +246,7 @@ sbin/snmptrapd
%%DATADIR%%/mib2c.column_enums.conf
%%DATADIR%%/mib2c.column_storage.conf
%%DATADIR%%/mib2c.conf
+%%DATADIR%%/mib2c.container.conf
%%DATADIR%%/mib2c.create-dataset.conf
%%DATADIR%%/mib2c.genhtml.conf
%%DATADIR%%/mib2c.int_watch.conf
@@ -252,6 +256,7 @@ sbin/snmptrapd
%%DATADIR%%/mib2c.notify.conf
%%DATADIR%%/mib2c.old-api.conf
%%DATADIR%%/mib2c.scalar.conf
+%%DATADIR%%/mib2c.table_data.conf
%%DATADIR%%/mib2c-data/default-mfd-top.m2c
%%DATADIR%%/mib2c-data/details-enums.m2i
%%DATADIR%%/mib2c-data/details-node.m2i