- update to Net-SNMP 5.5

- remove static libraries from -devel subpackage
- rediff all patches to 5.5, remove unused/obsolete patches
This commit is contained in:
Jan Šafránek 2009-09-29 15:23:38 +00:00
parent 209b537b63
commit efe9a18fdc
16 changed files with 93 additions and 1874 deletions

View File

@ -1 +1 @@
net-snmp-5.4.2.1.tar.gz
net-snmp-5.5.tar.gz

View File

@ -1,14 +0,0 @@
Assume that the configuration is in /etc/snmp, instead of /usr/share/snmp
diff -up net-snmp-5.4.1/net-snmp-config.in.backup_patch_6 net-snmp-5.4.1/net-snmp-config.in
--- net-snmp-5.4.1/net-snmp-config.in.backup_patch_6 2007-06-30 00:18:27.000000000 +0200
+++ net-snmp-5.4.1/net-snmp-config.in 2008-07-25 12:53:19.000000000 +0200
@@ -302,7 +302,7 @@ else
fi
echo $line >> $outfile
- outfile="@datadir@/snmp/snmpd.conf"
+ outfile="/etc/snmp/snmpd.conf"
line="$token $user"
echo "adding the following line to $outfile:"
echo " " $line

View File

@ -1,24 +0,0 @@
diff -up net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.c.file_offset net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.c
--- net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.c.file_offset 2004-06-19 15:34:11.000000000 +0200
+++ net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.c 2009-01-22 14:42:26.000000000 +0100
@@ -783,7 +783,7 @@ Get_FSIndex(char *dev)
return 0;
}
-long
+fsblkcnt_t
Get_FSSize(char *dev)
{
struct HRFS_statfs statfs_buf;
diff -up net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.h.file_offset net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.h
--- net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.h.file_offset 2002-07-04 14:56:35.000000000 +0200
+++ net-snmp-5.1.2/agent/mibgroup/host/hr_filesys.h 2009-01-22 14:42:26.000000000 +0100
@@ -12,7 +12,7 @@ extern int Get_Next_HR_FileSys(void
extern int Check_HR_FileSys_NFS(void);
extern int Get_FSIndex(char *);
-extern long Get_FSSize(char *); /* Temporary */
+extern fsblkcnt_t Get_FSSize(char *); /* Temporary */
#endif /* _MIBGROUP_HRFSYS_H */

View File

@ -1,21 +0,0 @@
diff -up net-snmp-5.4.1/man/read_config.3.def.backup_patch_8 net-snmp-5.4.1/man/read_config.3.def
--- net-snmp-5.4.1/man/read_config.3.def.backup_patch_8 2003-04-25 16:02:55.000000000 +0200
+++ net-snmp-5.4.1/man/read_config.3.def 2008-07-25 12:53:34.000000000 +0200
@@ -257,7 +257,7 @@ The configuration files read are found b
.I SNMPCONFPATH
environment variable (or its default value, which will be
SYSCONFDIR/snmp, followed by
-DATADIR/snmp, followed by LIBDIR/snmp, followed by $HOME/.snmp) and
+DATADIR/snmp, followed by /usr/lib/snmp (or /usr/lib64/snmp), followed by $HOME/.snmp) and
reading in the files found that match both the prefix registered and
the two suffixes
.I .conf
@@ -285,7 +285,7 @@ function that it should abort the operat
SNMPCONFPATH
A colon separated list of directories to search for configuration
files in.
-Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp
+Default: SYSCONFDIR/snmp:DATADIR/snmp:/usr/lib(64)/snmp:$HOME/.snmp
.SH "SEE ALSO"
.BR mib_api "(3), " snmp_api (3)
.\" Local Variables:

View File

@ -1,101 +0,0 @@
diff -up net-snmp-5.4.1/configure.backup_patch_9 net-snmp-5.4.1/configure
--- net-snmp-5.4.1/configure.backup_patch_9 2008-07-25 12:52:01.000000000 +0200
+++ net-snmp-5.4.1/configure 2008-07-25 12:53:35.000000000 +0200
@@ -5252,7 +5252,7 @@ freebsd* | dragonfly*)
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ lt_cv_file_magic_test_file=`echo $LIBDIR/libc.so.*`
;;
esac
else
@@ -5269,15 +5269,15 @@ hpux10.20* | hpux11*)
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ lt_cv_file_magic_test_file=$LIBDIR/hpux32/libc.so
;;
hppa*64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ lt_cv_file_magic_test_file=$LIBDIR/pa20_64/libc.sl
;;
*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ lt_cv_file_magic_test_file=$LIBDIR/libc.sl
;;
esac
;;
@@ -5313,7 +5313,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ lt_cv_file_magic_test_file=$LIBDIR/libnls.so
;;
nto-qnx*)
@@ -5344,7 +5344,7 @@ sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_file_magic_test_file=`echo $LIBDIR/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
@@ -8905,13 +8905,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test -z "$aix_libpath"; then aix_libpath="$LIBDIR:/lib"; fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ hardcode_libdir_flag_spec='${wl}-R $libdir:$LIBDIR:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
@@ -8973,7 +8973,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test -z "$aix_libpath"; then aix_libpath="$LIBDIR:/lib"; fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
@@ -9087,7 +9087,7 @@ if test -z "$aix_libpath"; then aix_libp
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags $LIBDIR/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -9504,7 +9504,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib $LIBDIR"
if test "$GCC" = yes; then
case $host_os in
@@ -9555,7 +9555,7 @@ BEGIN {RS=" "; FS="/|\n";} {
}'`
sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_search_path_spec="/lib $LIBDIR /usr/local/lib"
fi
need_lib_prefix=unknown
hardcode_into_libs=no

View File

@ -1,25 +0,0 @@
CVE-2008-6123: snmp queries allowed from each remote host regardless of
/etc/hosts.allow configuration
Source: upstream, SVN rev. 17367
diff -up net-snmp-5.4.2.1/snmplib/snmpUDPDomain.c.libwrap net-snmp-5.4.2.1/snmplib/snmpUDPDomain.c
--- net-snmp-5.4.2.1/snmplib/snmpUDPDomain.c.libwrap 2007-10-11 22:46:30.000000000 +0200
+++ net-snmp-5.4.2.1/snmplib/snmpUDPDomain.c 2009-02-16 11:57:19.000000000 +0100
@@ -104,12 +104,12 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t
char tmp[64];
to = (struct sockaddr_in *) &(addr_pair->remote_addr);
if (to == NULL) {
- sprintf(tmp, "UDP: [%s]->unknown",
+ sprintf(tmp, "UDP: unknown->[%s]",
inet_ntoa(addr_pair->local_addr));
} else {
- sprintf(tmp, "UDP: [%s]->", inet_ntoa(addr_pair->local_addr));
- sprintf(tmp + strlen(tmp), "[%s]:%hd",
- inet_ntoa(to->sin_addr), ntohs(to->sin_port));
+ sprintf(tmp, "UDP: [%s]:%hu->",
+ inet_ntoa(to->sin_addr), ntohs(to->sin_port));
+ sprintf(tmp + strlen(tmp), "[%s]", inet_ntoa(addr_pair->local_addr));
}
return strdup(tmp);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
TODO: remove with 5.4.3 - another approach is implemented upstream
diff -up net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.shared-ip net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
--- net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.shared-ip 2008-01-17 01:09:33.000000000 +0100
+++ net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c 2008-09-17 16:43:18.000000000 +0200
@@ -279,11 +279,15 @@ _netsnmp_ioctl_ipaddress_container_load_
/*
* add entry to container
*/
- if (CONTAINER_INSERT(container, entry) < 0)
- {
- DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
+ rc = CONTAINER_TRY_INSERT(container, entry);
+ if (rc < 0) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
+ logged = 1;
+ }
+ rc = 0;
netsnmp_access_ipaddress_entry_free(entry);
- continue;
}
}
diff -up net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.shared-ip net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
--- net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.shared-ip 2008-08-13 15:02:12.000000000 +0200
+++ net-snmp-5.4.2/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c 2008-09-17 16:43:18.000000000 +0200
@@ -325,7 +325,16 @@ _load_v6(netsnmp_container *container, i
/*
* add entry to container
*/
- CONTAINER_INSERT(container, entry);
+ rc = CONTAINER_TRY_INSERT(container, entry);
+ if (rc < 0) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
+ logged = 1;
+ }
+ netsnmp_access_ipaddress_entry_free(entry);
+ }
+
}
fclose(in);
diff -up net-snmp-5.4.2/include/net-snmp/library/container.h.shared-ip net-snmp-5.4.2/include/net-snmp/library/container.h
--- net-snmp-5.4.2/include/net-snmp/library/container.h.shared-ip 2008-02-14 00:37:48.000000000 +0100
+++ net-snmp-5.4.2/include/net-snmp/library/container.h 2008-09-17 16:43:18.000000000 +0200
@@ -406,8 +406,32 @@ extern "C" {
}
return rc;
+ }
+
+ NETSNMP_STATIC_INLINE
+ int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k)
+ {
+ const void *res = NULL;
+
+ netsnmp_container *start;
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+
+ start = x;
+
+ for(; x; x = x->next) {
+ if ((NULL != x->insert_filter) &&
+ (x->insert_filter(x,k) == 1))
+ continue;
+ res = x->find(x,k);
+ if (res) {
+ return -1;
+ }
+ }
+ return CONTAINER_INSERT(start, k);
}
-
+
/*------------------------------------------------------------------
* These functions should EXACTLY match the function version in
* container.c. If you change one, change them both.
diff -up net-snmp-5.4.2/snmplib/container.c.shared-ip net-snmp-5.4.2/snmplib/container.c
--- net-snmp-5.4.2/snmplib/container.c.shared-ip 2008-02-14 00:37:48.000000000 +0100
+++ net-snmp-5.4.2/snmplib/container.c 2008-09-17 16:43:18.000000000 +0200
@@ -323,6 +323,29 @@ int CONTAINER_REMOVE(netsnmp_container *
return rc;
}
+int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k)
+{
+ const void *res = NULL;
+
+ netsnmp_container *start;
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+
+ start = x;
+
+ for(; x; x = x->next) {
+ if ((NULL != x->insert_filter) &&
+ (x->insert_filter(x,k) == 1))
+ continue;
+ res = x->find(x,k);
+ if (res) {
+ return -1;
+ }
+ }
+ return CONTAINER_INSERT(start, k);
+}
+
/*------------------------------------------------------------------
* These functions should EXACTLY match the inline version in
* container.h. If you change one, change them both.

View File

@ -1,60 +0,0 @@
diff -up net-snmp-5.4.1/configure.backup_patch_11 net-snmp-5.4.1/configure
--- net-snmp-5.4.1/configure.backup_patch_11 2008-07-25 12:53:35.000000000 +0200
+++ net-snmp-5.4.1/configure 2008-07-25 12:53:39.000000000 +0200
@@ -27922,7 +27922,7 @@ if test "${with_libwrap+set}" = set; the
if test "$with_libwrap" != "no"; then
if test "$with_libwrap" != "yes"; then
CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
- LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
+ LDFLAGS="${LDFLAGS} -L$with_libwrap"
fi
_libs=${LIBS}
@@ -28126,7 +28126,7 @@ echo "${ECHO_T}yes" >&6
#define NETSNMP_USE_LIBWRAP 1
_ACEOF
- test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
_wraplibs="$_wraplibs -lwrap"
else
echo "$as_me: failed program was:" >&5
@@ -28354,7 +28354,7 @@ echo "${ECHO_T}yes" >&6
#define NETSNMP_USE_LIBWRAP 1
_ACEOF
- test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
_wraplibs="$_wraplibs -lwrap -lnsl"
else
echo "$as_me: failed program was:" >&5
diff -up net-snmp-5.4.1/configure.in.backup_patch_11 net-snmp-5.4.1/configure.in
--- net-snmp-5.4.1/configure.in.backup_patch_11 2007-07-27 19:02:00.000000000 +0200
+++ net-snmp-5.4.1/configure.in 2008-07-25 12:53:39.000000000 +0200
@@ -2714,7 +2714,7 @@ AC_ARG_WITH(libwrap,
if test "$with_libwrap" != "no"; then
if test "$with_libwrap" != "yes"; then
CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
- LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
+ LDFLAGS="${LDFLAGS} -L$with_libwrap"
fi
_libs=${LIBS}
@@ -2732,7 +2732,7 @@ AC_ARG_WITH(libwrap,
AC_MSG_RESULT([yes])
AC_DEFINE(NETSNMP_USE_LIBWRAP)
- test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
_wraplibs="$_wraplibs -lwrap"],
[
AC_MSG_RESULT([no])
@@ -2748,7 +2748,7 @@ AC_ARG_WITH(libwrap,
AC_MSG_RESULT(yes)
AC_DEFINE(NETSNMP_USE_LIBWRAP)
- test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
+ test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
_wraplibs="$_wraplibs -lwrap -lnsl",
AC_MSG_RESULT(no)

View File

@ -1,154 +0,0 @@
386611: snmpd segfaults on xen network interfaces
Source: http://sourceforge.net/tracker/index.php?func=detail&aid=1794532&group_id=12694&atid=112694
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
===================================================================
diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
--- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c.backup_patch_16 2007-07-17 01:59:44.000000000 +0200
+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2008-07-25 12:53:57.000000000 +0200
@@ -411,6 +411,7 @@ static int _access_ipaddress_entry_compa
{
const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
+ int rc;
netsnmp_assert(NULL != lhs);
netsnmp_assert(NULL != rhs);
@@ -426,5 +427,17 @@ static int _access_ipaddress_entry_compa
/*
* length equal, compare address
*/
- return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+ rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+ if (rc)
+ return rc;
+
+ /*
+ * address same, compare ifIndex
+ */
+ if (lh->if_index < rh->if_index)
+ return -1;
+ else if (lh->if_index > rh->if_index)
+ return 1;
+
+ return 0;
}
diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.backup_patch_16 2006-12-06 16:10:40.000000000 +0100
+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c 2008-07-25 12:53:57.000000000 +0200
@@ -348,10 +348,18 @@ ipAddressAddrType_map(u_long * mib_ipAdd
*mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
break;
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z;
+ break;
+
case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
*mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
break;
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z;
+ break;
+
default:
snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
raw_ipAddressAddrType_val);
@@ -382,8 +390,11 @@ int
ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
- size_t ipAddressAddr_val_ptr_len)
+ size_t ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex)
{
+ uint32_t zone = htonl(ipAddressAddr_ifIndex);
+
DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
/*
@@ -409,6 +420,11 @@ ipAddressTable_indexes_set_tbl_idx(ipAdd
memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
+ /** zone */
+ tbl_idx->ipAddressAddr_len += sizeof(zone);
+ memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len *
+ sizeof(ipAddressAddr_val_ptr[0])],
+ &zone, sizeof(zone));
return MFD_SUCCESS;
} /* ipAddressTable_indexes_set_tbl_idx */
@@ -430,7 +446,8 @@ int
ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
- size_t ipAddressAddr_val_ptr_len)
+ size_t ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex)
{
DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
"called\n"));
@@ -439,7 +456,8 @@ ipAddressTable_indexes_set(ipAddressTabl
ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
ipAddressAddrType_val,
ipAddressAddr_val_ptr,
- ipAddressAddr_val_ptr_len))
+ ipAddressAddr_val_ptr_len,
+ ipAddressAddr_ifIndex))
return MFD_ERROR;
/*
diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.backup_patch_16 2005-12-01 18:00:57.000000000 +0100
+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h 2008-07-25 12:53:57.000000000 +0200
@@ -106,7 +106,9 @@ extern "C" {
* simplistic map of address length to type
*/
#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5
#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17
/*************************************************************
diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.backup_patch_16 2007-05-17 23:53:28.000000000 +0200
+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c 2008-07-25 12:53:57.000000000 +0200
@@ -258,9 +258,10 @@ _add_new_entry(netsnmp_ipaddress_entry *
if ((NULL != rowreq_ctx) &&
(MFD_SUCCESS ==
ipAddressTable_indexes_set(rowreq_ctx,
- ipaddress_entry->ia_address_len,
+ ipaddress_entry->ia_address_len + 1,
ipaddress_entry->ia_address,
- ipaddress_entry->ia_address_len))) {
+ ipaddress_entry->ia_address_len,
+ ipaddress_entry->if_index))) {
if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
ipAddressTable_release_rowreq_ctx(rowreq_ctx);
diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.backup_patch_16 2006-01-25 17:28:12.000000000 +0100
+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h 2008-07-25 12:53:57.000000000 +0200
@@ -273,14 +273,16 @@ config_require(ip-mib/ipAddressTable/ipA
u_long ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
size_t
- ipAddressAddr_val_ptr_len);
+ ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex);
int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
rowreq_ctx,
u_long
ipAddressAddrType_val,
char *ipAddressAddr_val_ptr,
size_t
- ipAddressAddr_val_ptr_len);
+ ipAddressAddr_val_ptr_len,
+ u_long ipAddressAddr_ifIndex);

View File

@ -1,21 +0,0 @@
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;

View File

@ -0,0 +1,14 @@
Let net-snmp-create-v3-user save settings into /etc/ instead of /usr/
diff -up net-snmp-5.5/net-snmp-create-v3-user.in.orig net-snmp-5.5/net-snmp-create-v3-user.in
--- net-snmp-5.5/net-snmp-create-v3-user.in.orig 2008-07-22 16:33:25.000000000 +0200
+++ net-snmp-5.5/net-snmp-create-v3-user.in 2009-09-29 16:30:36.000000000 +0200
@@ -158,7 +158,7 @@ if test ! -d $outfile ; then
touch $outfile
fi
echo $line >> $outfile
-outfile="@datadir@/snmp/snmpd.conf"
+outfile="/etc/snmp/snmpd.conf"
line="$token $user"
echo "adding the following line to $outfile:"
echo " " $line

View File

@ -0,0 +1,47 @@
Make the man pages multilib safe.
diff -up net-snmp-5.5/man/config_api.3.def.orig net-snmp-5.5/man/config_api.3.def
--- net-snmp-5.5/man/config_api.3.def.orig 2009-04-21 11:36:52.000000000 +0200
+++ net-snmp-5.5/man/config_api.3.def 2009-09-29 11:45:44.000000000 +0200
@@ -256,7 +256,7 @@ machines and the second file can be used
for one particular machine.
.PP
The default list of directories to search is
-SYSCONFDIR/snmp, followed by DATADIR/snmp, followed by LIBDIR/snmp,
+SYSCONFDIR/snmp, followed by DATADIR/snmp, followed by /usr/lib(64)/snmp,
followed by $HOME/.snmp.
This list can be changed by setting the environmental variable
.I SNMPCONFPATH
@@ -326,7 +326,7 @@ function that it should abort the operat
SNMPCONFPATH
A colon separated list of directories to search for configuration
files in.
-Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp
+Default: SYSCONFDIR/snmp:DATADIR/snmp:/usr/lib(64)/snmp:$HOME/.snmp
.SH "SEE ALSO"
.BR mib_api "(3), " snmp_api (3)
.\" Local Variables:
diff -up net-snmp-5.5/man/snmp_config.5.def.orig net-snmp-5.5/man/snmp_config.5.def
--- net-snmp-5.5/man/snmp_config.5.def.orig 2007-06-18 23:17:15.000000000 +0200
+++ net-snmp-5.5/man/snmp_config.5.def 2009-09-29 11:45:22.000000000 +0200
@@ -11,7 +11,7 @@ First off, there are numerous places tha
found and read from. By default, the applications look for
configuration files in the following 4 directories, in order:
SYSCONFDIR/snmp,
-DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these
+DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these
directories, it looks for files with the extension of both
.IR conf " and " local.conf
(reading the second ones last). In this manner, there are
diff -up net-snmp-5.5/man/snmpd.conf.5.def.orig net-snmp-5.5/man/snmpd.conf.5.def
--- net-snmp-5.5/man/snmpd.conf.5.def.orig 2009-06-01 17:53:30.000000000 +0200
+++ net-snmp-5.5/man/snmpd.conf.5.def 2009-09-29 11:44:59.000000000 +0200
@@ -1272,7 +1272,7 @@ filename), and call the initialisation r
.RS
.IP "Note:"
If the specified PATH is not a fully qualified filename, it will
-be interpreted relative to LIBDIR/snmp/dlmod, and \fC.so\fR
+be interpreted relative to /usr/lib(64)/snmp/dlmod, and \fC.so\fR
will be appended to the filename.
.RE
.PP

View File

@ -0,0 +1,14 @@
Compile with lm_sensors3.
diff -up net-snmp-5.5/agent/mibgroup/hardware/sensors.h.orig net-snmp-5.5/agent/mibgroup/hardware/sensors.h
--- net-snmp-5.5/agent/mibgroup/hardware/sensors.h.orig 2009-04-24 00:53:26.000000000 +0200
+++ net-snmp-5.5/agent/mibgroup/hardware/sensors.h 2009-09-29 12:00:18.000000000 +0200
@@ -7,7 +7,7 @@ config_require(hardware/sensors/picld_se
config_require(hardware/sensors/kstat_sensors)
# endif
#else
-config_require(hardware/sensors/lmsensors_v2)
+config_require(hardware/sensors/lmsensors_v3)
#endif
/* config_require(hardware/sensors/dummy_sensors) */

View File

@ -3,12 +3,12 @@
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
%define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64
%define major_ver 5.4.2.1
%define major_ver 5.5
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: %{major_ver}
Release: 17%{?dist}
Release: 1%{?dist}
Epoch: 1
License: BSD and MIT
@ -25,16 +25,9 @@ Source7: net-snmp-config
Source8: net-snmp-trapd.redhat.conf
Source9: net-snmpd.sysconfig
Patch1: net-snmp-5.4.1-pie.patch
Patch2: net-snmp-5.1.2-dir-fix.patch
Patch3: net-snmp-5.2.1-file_offset.patch
Patch4: net-snmp-5.3.1-multilib.patch
Patch5: net-snmp-5.4.1-config_libdir.patch
Patch6: net-snmp-5.4.1-strange_libpath.patch
Patch7: net-snmp-5.4.1-shared-ip.patch
Patch8: net-snmp-5.4.1-sensors3.patch
Patch9: net-snmp-5.4.1-xen-crash.patch
Patch10: net-snmp-5.4.1-libwrap.patch
Patch11: net-snmp-5.4.2.1-proc-div0.patch
Patch2: net-snmp-5.5-dir-fix.patch
Patch3: net-snmp-5.5-multilib.patch
Patch4: net-snmp-5.5-sensors3.patch
Requires(pre): chkconfig
Requires(post): chkconfig
@ -166,15 +159,8 @@ Net-SNMP toolkit library.
%endif
%patch2 -p1 -b .dir-fix
%patch3 -p1 -b .file_offset
%patch4 -p1 -b .multilib
%patch5 -p1 -b .libdir
%patch6 -p1 -b .libpath
%patch7 -p1 -b .shared-ip
%patch8 -p1 -b .sensors
%patch9 -p1 -b .xen-crash
%patch10 -p1 -b .libwrap
%patch11 -p1 -b .proc-div0
%patch3 -p1 -b .multilib
%patch4 -p1 -b .sensors
# Do this patch with a perl hack...
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@ -194,7 +180,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
%endif
%configure \
--enable-static --enable-shared \
--disable-static --enable-shared \
--with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \
%ifnarch s390 s390x
--with-ldflags="$LDFLAGS -lcrypto -lsensors" \
@ -206,7 +192,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
--with-persistent-directory="/var/lib/net-snmp" \
--with-mib-modules="$MIBS" \
%if %{tcp_wrappers}
--with-libwrap=%{_libdir} \
--with-libwrap=yes \
%endif
--sysconfdir=%{_sysconfdir} \
--enable-ipv6 \
@ -219,9 +205,8 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
--with-sys-contact="root@localhost" <<EOF
EOF
#exit 0
make %{?smp_mflags}
make %{?_smp_mflags}
pushd perl
# Use just built libs for perl module building, not the system libs.
@ -372,10 +357,12 @@ rm -rf ${RPM_BUILD_ROOT}
%{_bindir}/ucd5820stat
%{_bindir}/ipf-mod.pl
%{_bindir}/snmpconf
%{_bindir}/net-snmp-create-v3-user
%{_sbindir}/*
%attr(0644,root,root) %{_mandir}/man[58]/snmp*d*
%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz
%attr(0644,root,root) %{_mandir}/man5/variables*
%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user*
%dir %{_datadir}/snmp
%{_datadir}/snmp/snmpconf-data
%dir %{_localstatedir}/lib/net-snmp
@ -393,7 +380,6 @@ rm -rf ${RPM_BUILD_ROOT}
%files devel
%defattr(0644,root,root,0755)
%{_libdir}/lib*.so
%{_libdir}/*.a
/usr/include/*
%attr(0644,root,root) %{_mandir}/man3/*.3.*
%attr(0755,root,root) %{_bindir}/net-snmp-config*
@ -429,6 +415,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mibs
%changelog
* Tue Sep 29 2009 Jan Safranek Jan Safranek <jsafranek@redhat.com> 5.5-1
- update to Net-SNMP 5.5
- remove static libraries from -devel subpackage
* Mon Sep 14 2009 Jan Safranek <orion@cora.nwra.com> 1:5.4.2.1-17
- implement force-reload command in initscripts (#523126)

View File

@ -1 +1 @@
984932520143f0c8bf7b7ce1fc9e1da1 net-snmp-5.4.2.1.tar.gz
5b2551e7bd024fbbee84dca22a5f13a1 net-snmp-5.5.tar.gz