Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Fedora Release Engineering | e13c1bff64 | |
Jan Šafránek | 3cacefaf9b | |
Bill Nottingham | 687a9591f1 | |
Jan Šafránek | ad8c3bbdc3 | |
Jan Šafránek | cd308a4c99 | |
Jan Šafránek | 21066a2818 | |
Jesse Keating | 38456140b9 |
21
Makefile
21
Makefile
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: net-snmp
|
||||
# $Id: Makefile,v 1.1 2004/09/09 09:07:47 cvsdist Exp $
|
||||
NAME := net-snmp
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attempt a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
|
@ -0,0 +1,26 @@
|
|||
512345: net-snmp not correctly returning hrSWRunPath
|
||||
|
||||
Source: upstream, SVN rev. 17460
|
||||
|
||||
Proper check for empty process status file.
|
||||
(Avoids truncated walk of hrSWRunPath on SuSE systems)
|
||||
Reported by Kamil Kisiel.
|
||||
|
||||
|
||||
|
||||
git-svn-id: https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/trunk@17460 06827809-a52a-0410-b366-d66718629ded
|
||||
|
||||
diff --git a/net-snmp/agent/mibgroup/host/hr_swrun.c b/net-snmp/agent/mibgroup/host/hr_swrun.c
|
||||
index b6ade26..71e5409 100644
|
||||
--- a/net-snmp/agent/mibgroup/host/hr_swrun.c
|
||||
+++ b/net-snmp/agent/mibgroup/host/hr_swrun.c
|
||||
@@ -752,8 +752,7 @@ var_hrswrun(struct variable * vp,
|
||||
sprintf(string, "/proc/%d/status", pid);
|
||||
if ((fp = fopen(string, "r")) == NULL)
|
||||
return NULL;
|
||||
- fgets(buf, sizeof(buf), fp); /* Name: process name */
|
||||
- if ( cp == NULL ) {
|
||||
+ if (!fgets(buf, sizeof(buf), fp)) {
|
||||
fclose(fp);
|
||||
return NULL; /* the process probably died */
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
501210: net-snmp SIGFPE 0x00002aaaab37744a in var_hrproc (vp=0x7fffffffbf50)
|
||||
|
||||
Author: Jan Safranek <jsafrane@redhat.com>
|
||||
Upstream as SVN rev. 17616.
|
||||
|
||||
Index: net-snmp/agent/mibgroup/host/hr_proc.c
|
||||
===================================================================
|
||||
--- net-snmp/agent/mibgroup/host/hr_proc.c (revision 17615)
|
||||
+++ net-snmp/agent/mibgroup/host/hr_proc.c (working copy)
|
||||
@@ -182,7 +182,10 @@
|
||||
return NULL;
|
||||
|
||||
long_return = (cpu->idle_ticks - cpu->history[0].idle_hist)*100;
|
||||
- long_return /= (cpu->total_ticks - cpu->history[0].total_hist);
|
||||
+ if (cpu->total_ticks > cpu->history[0].total_hist) /* avoid div. by 0 */
|
||||
+ long_return /= (cpu->total_ticks - cpu->history[0].total_hist);
|
||||
+ else
|
||||
+ long_return = 0;
|
||||
long_return = 100 - long_return;
|
||||
if (long_return < 0)
|
||||
long_return = 0;
|
|
@ -8,7 +8,7 @@
|
|||
Summary: A collection of SNMP protocol tools and libraries
|
||||
Name: net-snmp
|
||||
Version: %{major_ver}
|
||||
Release: 10%{?dist}
|
||||
Release: 14%{?dist}
|
||||
Epoch: 1
|
||||
|
||||
License: BSD and MIT
|
||||
|
@ -35,6 +35,8 @@ Patch10: net-snmp-5.4.1-shared-ip.patch
|
|||
Patch11: net-snmp-5.4.1-sensors3.patch
|
||||
Patch12: net-snmp-5.4.1-xen-crash.patch
|
||||
Patch13: net-snmp-5.4.1-libwrap.patch
|
||||
Patch14: net-snmp-5.4.2.1-proc-div0.patch
|
||||
Patch15: net-snmp-5.4.2.1-hrswprocpath.patch
|
||||
|
||||
Requires(pre): chkconfig
|
||||
Requires(post): chkconfig
|
||||
|
@ -173,6 +175,8 @@ Net-SNMP toolkit library.
|
|||
%patch11 -p1 -b .sensors
|
||||
%patch12 -p1 -b .xen-crash
|
||||
%patch13 -p1 -b .libwrap
|
||||
%patch14 -p1 -b .proc-div0
|
||||
%patch15 -p2 -b .hrswprocpath
|
||||
|
||||
# Do this patch with a perl hack...
|
||||
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
|
||||
|
@ -321,6 +325,10 @@ rm $RPM_BUILD_ROOT/%{_mandir}/man1/fixproc*
|
|||
# trim down massive ChangeLog
|
||||
dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
|
||||
|
||||
# generate empty .index in mibs directory. This ensures the .index has correct
|
||||
# SELinux context. The file get's rewritten when net-snmp libaries are first
|
||||
# used, but still we need the context...
|
||||
touch $RPM_BUILD_ROOT/%{_datadir}/snmp/mibs/.index
|
||||
|
||||
%post
|
||||
/sbin/chkconfig --add snmpd
|
||||
|
@ -342,7 +350,11 @@ if [ "$1" -ge "1" ]; then
|
|||
service snmptrapd condrestart >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
%post libs
|
||||
/sbin/ldconfig
|
||||
# Let net-snmp libraries regenerate /usr/share/snmp/mibs/.index,
|
||||
# just in case user has some additional mibs there.
|
||||
touch %{_datadir}/snmp/mibs/
|
||||
|
||||
%postun libs -p /sbin/ldconfig
|
||||
|
||||
|
@ -421,6 +433,16 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||
%{_datadir}/snmp/mibs
|
||||
|
||||
%changelog
|
||||
* Fri Feb 5 2010 Jan Safranek <jsafrane@redhat.com> 5.4.2.1-14
|
||||
- distribute .index file in mib directory to preven SELinux AVCs
|
||||
in applications using net-snmp libraries (#562001)
|
||||
|
||||
* Thu Nov 19 2009 Jan Safranek <jsafrane@redhat.com> 5.4.2.1-13
|
||||
- fix hrSWRunPath not being returned by snmpd (#512345)
|
||||
|
||||
* Mon May 18 2009 Jan Safranek <jsafranek@redhat.com> 5.4.2.1-12
|
||||
- fix divison-by-zero in cpu statistics (#501210)
|
||||
|
||||
* Fri Mar 06 2009 Jesse Keating <jkeating@redhat.com> - 5.4.2.1-10
|
||||
- Rebuild for new rpm
|
||||
|
||||
|
|
Loading…
Reference in New Issue