net-snmp/net-snmp-5.8-testing-empty-arptable.patch
Marcus Meissner d10b528e62 Accepting request 641283 from home:abergmann:branches:network:utilities
- Update to net-snmp-5.8.
  Fixes included:
  * Fix remote DoS in agent/helpers/table.c (bsc#1111122, CVE-2018-18065)
  * Fix agentx freezing on timeout (bsc#1027353)
  * swintst_rpm: Protect against unspecified Group name (bsc#1102775)
- Add tsm and tlstm MIBs and the USM security module. (bsc#1081164)
- Rename and refactor patches and remove those that are already included
  inside the new version.
  Added:
  * net-snmp-5.8-socket-path.patch
  * net-snmp-5.8-testing-empty-arptable.patch
  * net-snmp-5.8-pie.patch
  * net-snmp-5.8-net-snmp-config-headercheck.patch
  * net-snmp-5.8-perl-tk-warning.patch
  * net-snmp-5.8-velocity-mib.patch
  * net-snmp-5.8-netgroups.patch
  * net-snmp-5.8-snmpstatus-suppress-output.patch
  * net-snmp-5.8-fix-Makefile.PL.patch
  * net-snmp-5.8-modern-rpm-api.patch
  * net-snmp-5.8-fix-python3.patch
  Removed:
  * net-snmp-5.7.3-socket-path.patch
  * net-snmp-5.7.3-testing-empty-arptable.patch
  * net-snmp-5.7.3-pie.patch
  * net-snmp-5.7.3-net-snmp-config-headercheck.patch
  * net-snmp-5.7.3-perl-tk-warning.patch
  * net-snmp-5.7.3-velocity-mib.patch
  * net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch
  * net-snmp-5.7.3-netgroups.patch
  * net-snmp-5.7.3-snmpstatus-suppress-output.patch

OBS-URL: https://build.opensuse.org/request/show/641283
OBS-URL: https://build.opensuse.org/package/show/network:utilities/net-snmp?expand=0&rev=16
2018-10-15 15:40:54 +00:00

100 lines
2.5 KiB
Diff

Index: net-snmp-5.7.2/testing/rfc1213/snmpfun.sh
===================================================================
--- net-snmp-5.7.2.orig/testing/rfc1213/snmpfun.sh
+++ net-snmp-5.7.2/testing/rfc1213/snmpfun.sh
@@ -1,4 +1,3 @@
-
# functions used by RFC-1213 MIB test modules
myport=$SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT
@@ -11,6 +10,23 @@ else
TEST_AUTHPRIV_PARMS="-l authNoPriv -a MD5 -A testpass"
fi
+check_skip_arp_tests ()
+{
+ #
+ # skip all tests relying on a filed arp table. e.g. on s390 boxes this
+ # does not have to be the case
+ #
+ TABLE_ENTRIES="at.atTable ip.ipNetToMediaTable"
+ ARP_COUNT=`/sbin/arp | grep -v incomplete | wc -l`
+ for entry in $TABLE_ENTRIES ; do
+ if [ "x$1" == "x$entry" -a $ARP_COUNT == 0 ] ; then
+ echo "skipping $1, because the arp table is empty." >&2
+ return 0
+ fi
+ done
+ return 1
+}
+
config()
{
rm -f $SNMP_CONFIG_FILE
@@ -54,25 +70,35 @@ get_snmpv3_variable()
get_snmp_table()
{
test_start "Access table $2 by SNMPv$1..."
- CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
- CHECKFILE '' "\.$2\."
- if [ "$snmp_last_test_result" = 0 ] ; then
- test_finish FAIL
+ check_skip_arp_tests
+ if check_skip_arp_tests "$2" ; then
+ test_finish SKIPPED
else
- test_finish PASS
+ CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
+ CHECKFILE '' "\.$2\."
+ if [ "$snmp_last_test_result" = 0 ] ; then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
fi
}
get_snmpv3_table()
{
- test_start "Access table $2 by SNMPv3..."
- CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
- CHECKFILE '' "\.$2\."
- if [ "$snmp_last_test_result" = 0 ] ; then
- test_finish FAIL
+ test_start "Access table $2 by SNMPv3..."
+ if check_skip_arp_tests "$2" ; then
+ test_finish SKIPPED
else
- test_finish PASS
+ CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
+ CHECKFILE '' "\.$2\."
+ if [ "$snmp_last_test_result" = 0 ] ; then
+ test_finish FAIL
+ else
+ test_finish PASS
+ fi
fi
}
+
Index: net-snmp-5.7.2/testing/rfc1213/test_fun
===================================================================
--- net-snmp-5.7.2.orig/testing/rfc1213/test_fun
+++ net-snmp-5.7.2/testing/rfc1213/test_fun
@@ -51,6 +51,9 @@ test_finish()
if [ x$1 == x"PASS" ];then
pass_num=`expr $pass_num + 1`
pass_info "PASS\n"
+ elif [ x$1 == x"SKIPPED" ];then
+ pass_num=`expr $pass_num + 1`
+ pass_info "SKIPPED\n"
else
fail_num=`expr $fail_num + 1`
fail_info "FAIL\n"
@@ -66,3 +69,4 @@ summary()
fi
}
+