diff options
author | Martin Jackson <mjolnir@gentoo.org> | 2007-11-08 12:51:12 +0000 |
---|---|---|
committer | Martin Jackson <mjolnir@gentoo.org> | 2007-11-08 12:51:12 +0000 |
commit | 06f3a41cba9e4fd00cba5561d7855894f7926568 (patch) | |
tree | 61023d01c021cfb83fc1383d813681cb7ccef917 /net-analyzer | |
parent | Marked ~ppc (diff) | |
download | gentoo-2-06f3a41cba9e4fd00cba5561d7855894f7926568.tar.gz gentoo-2-06f3a41cba9e4fd00cba5561d7855894f7926568.tar.bz2 gentoo-2-06f3a41cba9e4fd00cba5561d7855894f7926568.zip |
Add patch and bump net-snmp-5.4 for 198346
(Portage version: 2.1.3.16)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/net-snmp/ChangeLog | 8 | ||||
-rw-r--r-- | net-analyzer/net-snmp/files/digest-net-snmp-5.4-r1 | 3 | ||||
-rw-r--r-- | net-analyzer/net-snmp/files/net-snmp-maxreps.patch | 122 | ||||
-rw-r--r-- | net-analyzer/net-snmp/net-snmp-5.4-r1.ebuild | 177 |
4 files changed, 309 insertions, 1 deletions
diff --git a/net-analyzer/net-snmp/ChangeLog b/net-analyzer/net-snmp/ChangeLog index ed6d44d4a242..4cba038d577b 100644 --- a/net-analyzer/net-snmp/ChangeLog +++ b/net-analyzer/net-snmp/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-analyzer/net-snmp # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/ChangeLog,v 1.154 2007/09/07 03:57:29 mjolnir Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/ChangeLog,v 1.155 2007/11/08 12:51:11 mjolnir Exp $ + + 08 Nov 2007; Martin Jackson <mjolnir@gentoo.org> + +files/net-snmp-maxreps.patch, +net-snmp-5.4-r1.ebuild: + Add maxreps patch from upstream, to fix #198346 + +*net-snmp-5.4-r1 (07 Nov 2007) 07 Sep 2007; Martin Jackson <mjolnir@gentoo.org> net-snmp-5.4.1-r1.ebuild: Add dep on setuptools to fix #191504 diff --git a/net-analyzer/net-snmp/files/digest-net-snmp-5.4-r1 b/net-analyzer/net-snmp/files/digest-net-snmp-5.4-r1 new file mode 100644 index 000000000000..2141580dd27e --- /dev/null +++ b/net-analyzer/net-snmp/files/digest-net-snmp-5.4-r1 @@ -0,0 +1,3 @@ +MD5 46d893281056ff476e597659cb91574d net-snmp-5.4.tar.gz 5031685 +RMD160 8ad1f9a3def8022eea48d9b74ae71d8efb59ca61 net-snmp-5.4.tar.gz 5031685 +SHA256 2f43cd6f3c4066f8c17fdc47931a96c1fce808c9d1dd74bcb5a79d9d29d5f947 net-snmp-5.4.tar.gz 5031685 diff --git a/net-analyzer/net-snmp/files/net-snmp-maxreps.patch b/net-analyzer/net-snmp/files/net-snmp-maxreps.patch new file mode 100644 index 000000000000..7d9627deaad5 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-maxreps.patch @@ -0,0 +1,122 @@ +Index: man/snmpd.conf.5.def +=================================================================== +--- man/snmpd.conf.5.def (revision 16338) ++++ man/snmpd.conf.5.def (working copy) +@@ -71,6 +71,28 @@ + .IP "leave_pidfile yes" + instructs the agent to not remove its pid file on shutdown. Equivalent to + specifying "-U" on the command line. ++.IP "maxGetbulkRepeats NUM" ++Sets the maximum number of responses allowed for a single variable in ++a getbulk request. Set to 0 to enable the default and set it to -1 to ++enable unlimited. Because memory is allocated ahead of time, sitting ++this to unlimited is not considered safe if your user population can ++not be trusted. A repeat number greater than this will be truncated ++to this value. ++.IP ++This is set by default to -1. ++.IP "maxGetbulkResponses NUM" ++Sets the maximum number of responses allowed for a getbulk request. ++This is set by default to 100. Set to 0 to enable the default and set ++it to -1 to enable unlimited. Because memory is allocated ahead of ++time, sitting this to unlimited is not considered safe if your user ++population can not be trusted. ++.IP ++In general, the total number of responses will not be allowed to ++exceed the maxGetbulkResponses number and the total number returned ++will be an integer multiple of the number of variables requested times ++the calculated number of repeats allow to fit below this number. ++.IP ++Also not that processing of maxGetbulkRepeats is handled first. + .SS SNMPv3 Configuration + SNMPv3 requires an SNMP agent to define a unique "engine ID" + in order to respond to SNMPv3 requests. +Index: include/net-snmp/agent/ds_agent.h +=================================================================== +--- include/net-snmp/agent/ds_agent.h (revision 16338) ++++ include/net-snmp/agent/ds_agent.h (working copy) +@@ -59,5 +59,7 @@ + #define NETSNMP_DS_AGENT_CACHE_TIMEOUT 10 /* default cache timeout */ + #define NETSNMP_DS_AGENT_INTERNAL_VERSION 11 /* used by internal queries */ + #define NETSNMP_DS_AGENT_INTERNAL_SECLEVEL 12 /* used by internal queries */ ++#define NETSNMP_DS_AGENT_MAX_GETBULKREPEATS 13 /* max getbulk repeats */ ++#define NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES 14 /* max getbulk respones */ + + #endif +Index: agent/agent_read_config.c +=================================================================== +--- agent/agent_read_config.c (revision 16338) ++++ agent/agent_read_config.c (working copy) +@@ -258,6 +258,12 @@ + netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects", + NETSNMP_DS_APPLICATION_ID, + NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS); ++ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkRepeats", ++ NETSNMP_DS_APPLICATION_ID, ++ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS); ++ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses", ++ NETSNMP_DS_APPLICATION_ID, ++ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES); + netsnmp_init_handler_conf(); + + #include "agent_module_dot_conf.h" +Index: agent/snmp_agent.c +=================================================================== +--- agent/snmp_agent.c (revision 16338) ++++ agent/snmp_agent.c (working copy) +@@ -2156,7 +2156,6 @@ + * getbulk prep + */ + int count = count_varbinds(asp->pdu->variables); +- + if (asp->pdu->errstat < 0) { + asp->pdu->errstat = 0; + } +@@ -2173,8 +2172,37 @@ + r = 0; + asp->bulkcache = NULL; + } else { ++ int numresponses; ++ int maxbulk = ++ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, ++ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS); ++ int maxresponses = ++ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, ++ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES); ++ ++ if (maxresponses == 0) ++ maxresponses = 100; /* more than reasonable default */ ++ ++ if (maxbulk == 0) ++ maxbulk = -1; ++ ++ /* limit getbulk number of repeats to a configured size */ ++ if (asp->pdu->errindex > maxbulk && maxbulk != -1) { ++ asp->pdu->errindex = maxbulk; ++ } ++ ++ numresponses = asp->pdu->errindex * r; ++ ++ /* limit getbulk number of getbulk responses to a configured size */ ++ if (maxresponses != -1 && numresponses > maxresponses) { ++ /* attempt to truncate this */ ++ asp->pdu->errindex = maxresponses/r; ++ numresponses = asp->pdu->errindex * r; ++ DEBUGMSGTL(("snmp_agent", "truncating number of getbulk repeats to %d\n", asp->pdu->errindex)); ++ } ++ + asp->bulkcache = +- (netsnmp_variable_list **) malloc(asp->pdu->errindex * r * ++ (netsnmp_variable_list **) malloc(numresponses * + sizeof(struct + varbind_list *)); + if (!asp->bulkcache) { +@@ -2184,6 +2212,8 @@ + } + DEBUGMSGTL(("snmp_agent", "GETBULK N = %d, M = %d, R = %d\n", + n, asp->pdu->errindex, r)); ++ fprintf(stderr, "GETBULK N = %d, M = %d, R = %d\n", ++ n, asp->pdu->errindex, r); + } + + /* diff --git a/net-analyzer/net-snmp/net-snmp-5.4-r1.ebuild b/net-analyzer/net-snmp/net-snmp-5.4-r1.ebuild new file mode 100644 index 000000000000..d9a40517c88e --- /dev/null +++ b/net-analyzer/net-snmp/net-snmp-5.4-r1.ebuild @@ -0,0 +1,177 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/net-snmp-5.4-r1.ebuild,v 1.1 2007/11/08 12:51:11 mjolnir Exp $ + +inherit fixheadtails flag-o-matic perl-module + +DESCRIPTION="Software for generating and retrieving SNMP data" +HOMEPAGE="http://net-snmp.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="as-is BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="diskio doc elf ipv6 lm_sensors mfd-rewrites minimal perl rpm selinux smux ssl tcpd X sendmail" + +DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + rpm? ( + app-arch/rpm + dev-libs/popt + app-arch/bzip2 + >=sys-libs/zlib-1.1.4 + ) + elf? ( dev-libs/elfutils ) + lm_sensors? ( sys-apps/lm_sensors )" + +RDEPEND="${DEPEND} + perl? ( + X? ( dev-perl/perl-tk ) + !minimal? ( dev-perl/TermReadKey ) + ) + selinux? ( sec-policy/selinux-snmpd )" + +DEPEND="${DEPEND} + >=sys-apps/sed-4 + doc? ( app-doc/doxygen )" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-makefile.patch + +# For #198346 - from upstream. Commited 5/7/2007, so 5.4.1+ not affected + epatch "${FILESDIR}"/${PN}-maxreps.patch + +# The lm_sensors patch has a memory leak +# If you can help, please attach a patch to bug 109785 + +# if use lm_sensors; then +# if use x86 || use amd64; then +# epatch "${FILESDIR}"/${PN}-lm_sensors.patch +# else +# eerror "Unfortunatly you are trying to enable lm_sensors support for an unsupported arch." +# eerror "please check the availability of sys-apps/lm_sensors - if it is available on" +# eerror "your arch, please file a bug about this." +# die "lm_sensors patch error: unsupported arch." +# fi +# fi + + # fix access violation in make check + sed -i -e 's/\(snmpd.*\)-Lf/\1-l/' testing/eval_tools.sh || \ + die "sed eval_tools.sh failed" + # fix path in fixproc + sed -i -e 's|\(database_file =.*\)/local\(.*\)$|\1\2|' local/fixproc || \ + die "sed fixproc failed" + + ht_fix_all +} + +src_compile() { + local mibs + + strip-flags + + # filter for bug #145960 + # as it seems that the option is not enough + filter-ldflags -Wl,--as-needed + + mibs="host ucd-snmp/dlmod" + use smux && mibs="${mibs} smux" + use sendmail && mibs="${mibs} mibII/mta_sendmail" + use lm_sensors && mibs="${mibs} ucd-snmp/lmSensors" + use diskio && mibs="${mibs} ucd-snmp/diskio" + + econf \ + --with-install-prefix="${D}" \ + --with-sys-location="Unknown" \ + --with-sys-contact="root@Unknown" \ + --with-default-snmp-version="3" \ + --with-mib-modules="${mibs}" \ + --with-logfile="/var/log/net-snmpd.log" \ + --with-persistent-directory="/var/lib/net-snmp" \ + --enable-ucd-snmp-compatibility \ + --enable-shared \ + --enable-as-needed \ + $(use_enable mfd-rewrites) \ + $(use_enable perl embedded-perl) \ + $(use_enable ipv6) \ + $(use_enable !ssl internal-md5) \ + $(use_with ssl openssl) \ + $(use_with tcpd libwrap) \ + $(use_with rpm) \ + $(use_with rpm bzip2) \ + $(use_with rpm zlib) \ + $(use_with elf) \ + || die "econf failed" + + emake -j1 || die "emake failed" + + if use perl ; then + emake perlmodules || die "compile perl modules problem" + fi + + if use doc ; then + einfo "Building HTML Documentation" + make docsdox || die "failed to build docs" + fi +} + +src_test() { + cd testing + if ! make test ; then + echo + einfo "Don't be alarmed if a few tests FAIL." + einfo "This could happen for several reasons:" + einfo " - You don't already have a working configuration." + einfo " - Your ethernet interface isn't properly configured." + echo + fi +} + +src_install () { + make DESTDIR="${D}" install || die "make install failed" + + if use perl ; then + make DESTDIR="${D}" perlinstall || die "make perlinstall failed" + fixlocalpod + + use X || rm -f "${D}/usr/bin/tkmib" + else + rm -f "${D}/usr/bin/mib2c" "${D}/usr/bin/tkmib" "${D}/usr/bin/snmpcheck" + fi + + dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO + newdoc EXAMPLE.conf.def EXAMPLE.conf + + use doc && dohtml docs/html/* + + keepdir /etc/snmp /var/lib/net-snmp + + newinitd "${FILESDIR}"/snmpd.rc7 snmpd + newconfd "${FILESDIR}"/snmpd.conf snmpd + + newinitd "${FILESDIR}"/snmptrapd.rc7 snmptrapd + newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd + + # Remove everything, keeping only the snmpd, snmptrapd, MIBs, libs, and includes. + if use minimal; then + elog "USE=minimal is set. Cleaning up excess cruft for a embedded/minimal/server only install." + rm -rf + "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,snmpcheck}} + rm -rf "${D}"/usr/share/snmp/snmpconf-data "${D}"/usr/share/snmp/*.conf + rm -rf "${D}"/usr/bin/{fixproc,traptoemail} "${D}"/usr/bin/snmpc{heck,onf} + find "${D}" -name '*.pl' -exec rm -f '{}' \; + use ipv6 || rm -rf "${D}"/usr/share/snmp/mibs/IPV6* + fi + + # bug 113788, install example config + insinto /etc/snmp + newins "${S}"/EXAMPLE.conf snmpd.conf.example +} + +pkg_postinst() { + elog "An example configuration file has been installed in" + elog "/etc/snmp/snmpd.conf.example." +} |