Hello community, here is the log from the commit of package net-snmp for openSUSE:Factory checked in at 2018-10-25 08:11:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/net-snmp (Old) and /work/SRC/openSUSE:Factory/.net-snmp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "net-snmp" Thu Oct 25 08:11:05 2018 rev:88 rq:642087 version:5.8 Changes: -------- --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp.changes 2018-10-12 13:07:58.723531992 +0200 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp.changes 2018-10-25 08:11:10.752233714 +0200 @@ -1,0 +2,42 @@ +Wed Oct 10 20:22:35 UTC 2018 - [email protected] + +- 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 + * net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch + * net-snmp-5.7.3-Remove-U64-typedef.patch + * net-snmp-5.7.3-Fix-Makefile.PL.patch + * net-snmp-5.7.3-build-with-openssl-1.1.patch + * net-snmp-5.7.3-modern-rpm-api.patch + * net-snmp-python3.patch + * net-snmp-5.7.2-systemd.patch + * net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch + +------------------------------------------------------------------- Old: ---- net-snmp-5.7.2-systemd.patch net-snmp-5.7.3-Fix-Makefile.PL.patch net-snmp-5.7.3-Remove-U64-typedef.patch net-snmp-5.7.3-build-with-openssl-1.1.patch net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch net-snmp-5.7.3-modern-rpm-api.patch net-snmp-5.7.3-net-snmp-config-headercheck.patch net-snmp-5.7.3-netgroups.patch net-snmp-5.7.3-perl-tk-warning.patch net-snmp-5.7.3-pie.patch net-snmp-5.7.3-snmpstatus-suppress-output.patch net-snmp-5.7.3-socket-path.patch net-snmp-5.7.3-testing-empty-arptable.patch net-snmp-5.7.3-velocity-mib.patch net-snmp-5.7.3.tar.gz net-snmp-python3.patch New: ---- net-snmp-5.8-fix-Makefile.PL.patch net-snmp-5.8-fix-python3.patch net-snmp-5.8-modern-rpm-api.patch net-snmp-5.8-net-snmp-config-headercheck.patch net-snmp-5.8-netgroups.patch net-snmp-5.8-perl-tk-warning.patch net-snmp-5.8-pie.patch net-snmp-5.8-snmpstatus-suppress-output.patch net-snmp-5.8-socket-path.patch net-snmp-5.8-testing-empty-arptable.patch net-snmp-5.8-velocity-mib.patch net-snmp-5.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ net-snmp.spec ++++++ --- /var/tmp/diff_new_pack.B0rSAK/_old 2018-10-25 08:11:11.692233099 +0200 +++ /var/tmp/diff_new_pack.B0rSAK/_new 2018-10-25 08:11:11.692233099 +0200 @@ -30,7 +30,7 @@ %define libname libsnmp30 %bcond_without python2 Name: net-snmp -Version: 5.7.3 +Version: 5.8 Release: 0 Summary: SNMP Daemon License: BSD-3-Clause AND MIT @@ -48,23 +48,17 @@ Source20: net-snmp-tmpfs.conf Source98: net-snmp-rpmlintrc Source99: baselibs.conf -Patch1: net-snmp-5.7.3-socket-path.patch -Patch2: net-snmp-5.7.3-testing-empty-arptable.patch -Patch3: net-snmp-5.7.3-pie.patch -Patch4: net-snmp-5.7.3-net-snmp-config-headercheck.patch -Patch5: net-snmp-5.7.3-perl-tk-warning.patch -Patch6: net-snmp-5.7.3-velocity-mib.patch -Patch7: net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch -Patch8: net-snmp-5.7.3-netgroups.patch -Patch9: net-snmp-5.7.3-snmpstatus-suppress-output.patch -Patch10: net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch -Patch11: net-snmp-5.7.3-Remove-U64-typedef.patch -Patch12: net-snmp-5.7.3-Fix-Makefile.PL.patch -Patch13: net-snmp-5.7.3-build-with-openssl-1.1.patch -Patch14: net-snmp-5.7.3-modern-rpm-api.patch -Patch15: net-snmp-python3.patch -Patch16: net-snmp-5.7.2-systemd.patch -Patch17: net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch +Patch1: net-snmp-5.8-socket-path.patch +Patch2: net-snmp-5.8-testing-empty-arptable.patch +Patch3: net-snmp-5.8-pie.patch +Patch4: net-snmp-5.8-net-snmp-config-headercheck.patch +Patch5: net-snmp-5.8-perl-tk-warning.patch +Patch6: net-snmp-5.8-velocity-mib.patch +Patch7: net-snmp-5.8-netgroups.patch +Patch8: net-snmp-5.8-snmpstatus-suppress-output.patch +Patch9: net-snmp-5.8-fix-Makefile.PL.patch +Patch10: net-snmp-5.8-modern-rpm-api.patch +Patch11: net-snmp-5.8-fix-python3.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: autoconf @@ -215,7 +209,8 @@ MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \ ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \ - ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable" + ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ + tsm-mib tlstm-mib" %if 0%{?netsnmp_with_sensors} MIBS="$MIBS ucd-snmp/lmsensorsMib" @@ -242,7 +237,7 @@ --enable-local-smux \ --enable-ipv6 \ --enable-ucd-snmp-compatibility \ - --with-security-modules=tsm \ + --with-security-modules=tsm,usm \ --with-transports=TLSTCP,DTLSUDP \ --with-systemd @@ -345,6 +340,10 @@ %{_bindir}/net-snmp-cert %{_bindir}/agentxtrap %{_bindir}/snmp-bridge-mib +%{_bindir}/checkbandwidth +%{_bindir}/snmpping +%{_bindir}/snmpps +%{_bindir}/snmptop %dir %{_libexecdir}/net-snmp %dir %{_libexecdir}/net-snmp/agents %{_mandir}/man[158]/* @@ -383,7 +382,7 @@ %files -n perl-SNMP %{perl_vendorarch}/auto/SNMP %{perl_vendorarch}/auto/NetSNMP -%{perl_vendorarch}/auto/Bundle +%{perl_vendorarch}/Bundle %{perl_vendorarch}/SNMP.pm %{perl_vendorarch}/NetSNMP %{_bindir}/tkmib ++++++ net-snmp-5.8-fix-Makefile.PL.patch ++++++ diff -Nurp net-snmp-5.8-orig/perl/ASN/Makefile.PL net-snmp-5.8/perl/ASN/Makefile.PL --- net-snmp-5.8-orig/perl/ASN/Makefile.PL 2018-10-10 09:45:14.875074783 +0000 +++ net-snmp-5.8/perl/ASN/Makefile.PL 2018-10-10 15:02:06.342732928 +0000 @@ -8,6 +8,7 @@ use Config; use MakefileSubs; my $lib_version; +my %MakeParams = (); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. diff -Nurp net-snmp-5.8-orig/perl/Makefile.PL net-snmp-5.8/perl/Makefile.PL --- net-snmp-5.8-orig/perl/Makefile.PL 2018-10-10 09:45:14.875074783 +0000 +++ net-snmp-5.8/perl/Makefile.PL 2018-10-10 15:02:25.810916073 +0000 @@ -4,6 +4,7 @@ use ExtUtils::MakeMaker; use Config; require 5; use MakefileSubs; +my %MakeParams = (); WriteMakefile(TopLevelInitMakeParams()); ++++++ net-snmp-5.8-fix-python3.patch ++++++ diff -Nurp net-snmp-5.8-orig/python/netsnmp/client.py net-snmp-5.8/python/netsnmp/client.py --- net-snmp-5.8-orig/python/netsnmp/client.py 2018-10-10 09:45:14.951075479 +0000 +++ net-snmp-5.8/python/netsnmp/client.py 2018-10-10 19:40:47.130879742 +0000 @@ -34,12 +34,12 @@ def _parse_session_args(kargs): 'TheirHostname':'', 'TrustCert':'' } - keys = kargs.keys() + keys = list(kargs.keys()) for key in keys: - if sessArgs.has_key(key): + if key in sessArgs: sessArgs[key] = kargs[key] else: - print >>stderr, "ERROR: unknown key", key + print("ERROR: unknown key", key, file=stderr) return sessArgs def STR(obj): @@ -132,7 +132,7 @@ class Session(object): sess_args = _parse_session_args(args) - for k, v in sess_args.items(): + for k, v in list(sess_args.items()): self.__dict__[k] = v diff -Nurp net-snmp-5.8-orig/python/netsnmp/client_intf.c net-snmp-5.8/python/netsnmp/client_intf.c --- net-snmp-5.8-orig/python/netsnmp/client_intf.c 2018-10-10 09:45:14.951075479 +0000 +++ net-snmp-5.8/python/netsnmp/client_intf.c 2018-10-10 19:52:16.993235587 +0000 @@ -853,7 +853,11 @@ py_netsnmp_attr_string(PyObject *obj, ch PyObject *attr = PyObject_GetAttrString(obj, attr_name); if (attr) { int retval; +#if PY_MAJOR_VERSION >= 3 + retval = PyBytes_AsStringAndSize(attr, val, len); +#else retval = PyString_AsStringAndSize(attr, val, len); +#endif Py_DECREF(attr); return retval; } @@ -870,7 +874,11 @@ py_netsnmp_attr_long(PyObject *obj, char if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { PyObject *attr = PyObject_GetAttrString(obj, attr_name); if (attr) { +#if PY_MAJOR_VERSION >= 3 + val = PyLong_AsLong(attr); +#else val = PyInt_AsLong(attr); +#endif Py_DECREF(attr); } } @@ -955,13 +963,22 @@ __py_netsnmp_update_session_errors(PyObj py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str)); +#if PY_MAJOR_VERSION >= 3 + tmp_for_conversion = PyLong_FromLong(err_num); +#else tmp_for_conversion = PyInt_FromLong(err_num); +#endif + if (!tmp_for_conversion) return; /* nothing better to do? */ PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion); Py_DECREF(tmp_for_conversion); +#if PY_MAJOR_VERSION >= 3 + tmp_for_conversion = PyLong_FromLong(err_ind); +#else tmp_for_conversion = PyInt_FromLong(err_ind); +#endif if (!tmp_for_conversion) return; /* nothing better to do? */ PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion); @@ -2490,13 +2507,28 @@ static PyMethodDef ClientMethods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef ClientModuleDef = { + PyModuleDef_HEAD_INIT, + "client_intf", + NULL, + -1, + ClientMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC +PyInit_client_intf(void) +{ + return PyModule_Create(&ClientModuleDef); +} +#else PyMODINIT_FUNC initclient_intf(void) { (void) Py_InitModule("client_intf", ClientMethods); } - - - - - +#endif diff -Nurp net-snmp-5.8-orig/python/netsnmp/tests/test.py net-snmp-5.8/python/netsnmp/tests/test.py --- net-snmp-5.8-orig/python/netsnmp/tests/test.py 2018-10-10 09:45:14.951075479 +0000 +++ net-snmp-5.8/python/netsnmp/tests/test.py 2018-10-10 19:46:04.689790403 +0000 @@ -62,107 +62,107 @@ class BasicTests(unittest.TestCase): self.assertEqual(var.iid, '') def test_v1_get(self): - print "\n" - print "---v1 GET tests -------------------------------------\n" + print("\n") + print("---v1 GET tests -------------------------------------\n") var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') res = netsnmp.snmpget(var, **snmp_dest()) - print "v1 snmpget result: ", res, "\n" + print("v1 snmpget result: ", res, "\n") self.assertEqual(len(res), 1) - print "v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print("v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertEqual(var.tag, 'sysDescr') self.assertEqual(var.iid, '0') self.assertEqual(var.val, res[0]) self.assertEqual(var.type, 'OCTETSTR') def test_v1_getnext(self): - print "\n" - print "---v1 GETNEXT tests-------------------------------------\n" + print("\n") + print("---v1 GETNEXT tests-------------------------------------\n") var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') res = netsnmp.snmpgetnext(var, **snmp_dest()) - print "v1 snmpgetnext result: ", res, "\n" + print("v1 snmpgetnext result: ", res, "\n") self.assertEqual(len(res), 1) - print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertTrue(var.tag is not None) self.assertTrue(var.iid is not None) self.assertTrue(var.val is not None) self.assertTrue(var.type is not None) def test_v1_set(self): - print "\n" - print "---v1 SET tests-------------------------------------\n" + print("\n") + print("---v1 SET tests-------------------------------------\n") var = netsnmp.Varbind('sysLocation', '0', 'my new location') res = netsnmp.snmpset(var, **snmp_dest()) - print "v1 snmpset result: ", res, "\n" + print("v1 snmpset result: ", res, "\n") self.assertEqual(res, 1) - print "v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print("v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertEqual(var.tag, 'sysLocation') self.assertEqual(var.iid, '0') self.assertEqual(var.val, 'my new location') self.assertTrue(var.type is None) def test_v1_walk(self): - print "\n" - print "---v1 walk tests-------------------------------------\n" + print("\n") + print("---v1 walk tests-------------------------------------\n") varlist = netsnmp.VarList(netsnmp.Varbind('system')) - print "v1 varlist walk in: " + print("v1 varlist walk in: ") for var in varlist: - print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') res = netsnmp.snmpwalk(varlist, **snmp_dest()) - print "v1 snmpwalk result: ", res, "\n" + print("v1 snmpwalk result: ", res, "\n") self.assertTrue(len(res) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') def test_v1_walk_2(self): - print "\n" - print "---v1 walk 2-------------------------------------\n" + print("\n") + print("---v1 walk 2-------------------------------------\n") - print "v1 varbind walk in: " + print("v1 varbind walk in: ") var = netsnmp.Varbind('system') self.assertEqual(var.tag, 'system') self.assertEqual(var.iid, '') self.assertEqual(var.val, None) self.assertEqual(var.type, None) res = netsnmp.snmpwalk(var, **snmp_dest()) - print "v1 snmpwalk result (should be = orig): ", res, "\n" + print("v1 snmpwalk result (should be = orig): ", res, "\n") self.assertTrue(len(res) > 0) - print var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertEqual(var.tag, 'system') self.assertEqual(var.iid, '') self.assertEqual(var.val, None) self.assertEqual(var.type, None) def test_v1_mv_get(self): - print "\n" - print "---v1 multi-varbind test-------------------------------------\n" + print("\n") + print("---v1 multi-varbind test-------------------------------------\n") sess = setup_v1() varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), netsnmp.Varbind('sysContact', 0), netsnmp.Varbind('sysLocation', 0)) vals = sess.get(varlist) - print "v1 sess.get result: ", vals, "\n" + print("v1 sess.get result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') vals = sess.getnext(varlist) - print "v1 sess.getnext result: ", vals, "\n" + print("v1 sess.getnext result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), netsnmp.Varbind('sysORLastChange'), @@ -171,71 +171,71 @@ class BasicTests(unittest.TestCase): netsnmp.Varbind('sysORUpTime')) vals = sess.getbulk(2, 8, varlist) - print "v1 sess.getbulk result: ", vals, "\n" + print("v1 sess.getbulk result: ", vals, "\n") self.assertEqual(vals, None) # GetBulk is not supported for v1 for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') def test_v1_set_2(self): - print "\n" - print "---v1 set2-------------------------------------\n" + print("\n") + print("---v1 set2-------------------------------------\n") sess = setup_v1() varlist = netsnmp.VarList( netsnmp.Varbind('sysLocation', '0', 'my newer location')) res = sess.set(varlist) - print "v1 sess.set result: ", res, "\n" + print("v1 sess.set result: ", res, "\n") def test_v1_walk_3(self): - print "\n" - print "---v1 walk3-------------------------------------\n" + print("\n") + print("---v1 walk3-------------------------------------\n") sess = setup_v1() varlist = netsnmp.VarList(netsnmp.Varbind('system')) vals = sess.walk(varlist) - print "v1 sess.walk result: ", vals, "\n" + print("v1 sess.walk result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') def test_v2c_get(self): - print "\n" - print "---v2c get-------------------------------------\n" + print("\n") + print("---v2c get-------------------------------------\n") sess = setup_v2() varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), netsnmp.Varbind('sysContact', 0), netsnmp.Varbind('sysLocation', 0)) vals = sess.get(varlist) - print "v2 sess.get result: ", vals, "\n" + print("v2 sess.get result: ", vals, "\n") self.assertEqual(len(vals), 3) def test_v2c_getnext(self): - print "\n" - print "---v2c getnext-------------------------------------\n" + print("\n") + print("---v2c getnext-------------------------------------\n") sess = setup_v2() varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), netsnmp.Varbind('sysContact', 0), netsnmp.Varbind('sysLocation', 0)) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") vals = sess.getnext(varlist) - print "v2 sess.getnext result: ", vals, "\n" + print("v2 sess.getnext result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") def test_v2c_getbulk(self): - print "\n" - print "---v2c getbulk-------------------------------------\n" + print("\n") + print("---v2c getbulk-------------------------------------\n") sess = setup_v2() varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), @@ -245,16 +245,16 @@ class BasicTests(unittest.TestCase): netsnmp.Varbind('sysORUpTime')) vals = sess.getbulk(2, 8, varlist) - print "v2 sess.getbulk result: ", vals, "\n" + print("v2 sess.getbulk result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") def test_v2c_set(self): - print "\n" - print "---v2c set-------------------------------------\n" + print("\n") + print("---v2c set-------------------------------------\n") sess = setup_v2() @@ -262,54 +262,54 @@ class BasicTests(unittest.TestCase): netsnmp.Varbind('sysLocation', '0', 'my even newer location')) res = sess.set(varlist) - print "v2 sess.set result: ", res, "\n" + print("v2 sess.set result: ", res, "\n") self.assertEqual(res, 1) def test_v2c_walk(self): - print "\n" - print "---v2c walk-------------------------------------\n" + print("\n") + print("---v2c walk-------------------------------------\n") sess = setup_v2() varlist = netsnmp.VarList(netsnmp.Varbind('system')) vals = sess.walk(varlist) - print "v2 sess.walk result: ", vals, "\n" + print("v2 sess.walk result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') def test_v3_get(self): - print "\n" + print("\n") sess = setup_v3(); varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), netsnmp.Varbind('sysContact', 0), netsnmp.Varbind('sysLocation', 0)) - print "---v3 get-------------------------------------\n" + print("---v3 get-------------------------------------\n") vals = sess.get(varlist) - print "v3 sess.get result: ", vals, "\n" + print("v3 sess.get result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") def test_v3_getnext(self): - print "\n" - print "---v3 getnext-------------------------------------\n" + print("\n") + print("---v3 getnext-------------------------------------\n") sess = setup_v3(); varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), netsnmp.Varbind('sysContact', 0), netsnmp.Varbind('sysLocation', 0)) vals = sess.getnext(varlist) - print "v3 sess.getnext result: ", vals, "\n" + print("v3 sess.getnext result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") def test_v3_getbulk(self): sess = setup_v3(); @@ -320,47 +320,47 @@ class BasicTests(unittest.TestCase): netsnmp.Varbind('sysORUpTime')) vals = sess.getbulk(2, 8, varlist) - print "v3 sess.getbulk result: ", vals, "\n" + print("v3 sess.getbulk result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") def test_v3_set(self): - print "\n" - print "---v3 set-------------------------------------\n" + print("\n") + print("---v3 set-------------------------------------\n") sess = setup_v3(); varlist = netsnmp.VarList( netsnmp.Varbind('sysLocation', '0', 'my final destination')) res = sess.set(varlist) - print "v3 sess.set result: ", res, "\n" + print("v3 sess.set result: ", res, "\n") self.assertEqual(res, 1) def test_v3_walk(self): - print "\n" - print "---v3 walk-------------------------------------\n" + print("\n") + print("---v3 walk-------------------------------------\n") sess = setup_v3(); varlist = netsnmp.VarList(netsnmp.Varbind('system')) vals = sess.walk(varlist) - print "v3 sess.walk result: ", vals, "\n" + print("v3 sess.walk result: ", vals, "\n") self.assertTrue(len(vals) > 0) for var in varlist: - print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') class SetTests(unittest.TestCase): """SNMP set tests for the Net-SNMP Python interface""" def testFuncs(self): """Test code""" - print "\n-------------- SET Test Start ----------------------------\n" + print("\n-------------- SET Test Start ----------------------------\n") var = netsnmp.Varbind('sysUpTime', '0') res = netsnmp.snmpget(var, **snmp_dest()) - print "uptime = ", res[0] + print("uptime = ", res[0]) self.assertEqual(len(res), 1) @@ -370,19 +370,19 @@ class SetTests(unittest.TestCase): var = netsnmp.Varbind('sysUpTime', '0') res = netsnmp.snmpget(var, **snmp_dest()) - print "uptime = ", res[0] + print("uptime = ", res[0]) self.assertEqual(len(res), 1) var = netsnmp.Varbind('nsCacheEntry') res = netsnmp.snmpgetnext(var, **snmp_dest()) - print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertEqual(len(res), 1) var.val = 65 res = netsnmp.snmpset(var, **snmp_dest()) self.assertEqual(res, 1) res = netsnmp.snmpget(var, **snmp_dest()) - print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' + print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') self.assertEqual(len(res), 1) self.assertEqual(res[0], '65'); @@ -394,7 +394,7 @@ class SetTests(unittest.TestCase): netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 4)) res = sess.set(varlist) - print "res = ", res + print("res = ", res) self.assertEqual(res, 1) varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), @@ -414,15 +414,15 @@ class SetTests(unittest.TestCase): self.assertEqual(varlist[2].val, '3') for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") varlist = netsnmp.VarList( netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 6)) res = sess.set(varlist) - print "res = ", res + print("res = ", res) self.assertEqual(res, 1) varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), @@ -436,10 +436,10 @@ class SetTests(unittest.TestCase): self.assertNotEqual(varlist[2].tag, 'snmpTargetAddrRowStatus') for var in varlist: - print var.tag, var.iid, "=", var.val, '(', var.type, ')' - print "\n" + print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + print("\n") - print "\n-------------- SET Test End ----------------------------\n" + print("\n-------------- SET Test End ----------------------------\n") if __name__ == '__main__': diff -Nurp net-snmp-5.8-orig/python/setup.py net-snmp-5.8/python/setup.py --- net-snmp-5.8-orig/python/setup.py 2018-10-10 09:45:14.951075479 +0000 +++ net-snmp-5.8/python/setup.py 2018-10-10 19:38:51.185817022 +0000 @@ -9,9 +9,9 @@ intree=0 args = sys.argv[:] for arg in args: - if string.find(arg,'--basedir=') == 0: - basedir = string.split(arg,'=')[1] - sys.argv.remove(arg) + if arg.find('--basedir=') == 0: + basedir = arg.split('=')[1] + sys.argv.remove(arg) intree=1 if intree: ++++++ net-snmp-5.7.3-modern-rpm-api.patch -> net-snmp-5.8-modern-rpm-api.patch ++++++ --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3-modern-rpm-api.patch 2017-12-21 11:23:44.571934575 +0100 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8-modern-rpm-api.patch 2018-10-25 08:11:08.348235289 +0200 @@ -1,20 +1,20 @@ -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c 2017-08-11 00:16:35.232470439 +0200 -@@ -96,8 +96,7 @@ - - rpmdbMatchIterator mi; - Header h; +diff -Nurp net-snmp-5.8-orig/agent/mibgroup/host/data_access/swinst_rpm.c net-snmp-5.8/agent/mibgroup/host/data_access/swinst_rpm.c +--- net-snmp-5.8-orig/agent/mibgroup/host/data_access/swinst_rpm.c 2018-10-10 09:45:14.907075076 +0000 ++++ net-snmp-5.8/agent/mibgroup/host/data_access/swinst_rpm.c 2018-10-10 19:31:51.161967195 +0000 +@@ -101,8 +101,7 @@ netsnmp_swinst_arch_load( netsnmp_contai + const char *g; + rpmtd td_name, td_version, td_release, td_group, td_time; + #else - char *n, *v, *r, *g; - int32_t *t; + const char *n, *v, *r, *g; + #endif time_t install_time; size_t date_len; - int i = 1; -@@ -119,11 +118,11 @@ - CONTAINER_INSERT(container, entry); - - h = headerLink( h ); +@@ -146,14 +145,14 @@ netsnmp_swinst_arch_load( netsnmp_contai + install_time = rpmtdGetNumber(td_time); + g = rpmtdGetString(td_group); + #else - headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL); - headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL); - headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL); @@ -25,21 +25,17 @@ + r = headerGetString( h, RPMTAG_RELEASE); + g = headerGetString( h, RPMTAG_GROUP); + install_time = headerGetNumber( h, RPMTAG_INSTALLTIME); - ++ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName), "%s-%s-%s", n, v, r); -@@ -133,7 +132,6 @@ - ? 2 /* operatingSystem */ - : 4; /* application */ - - install_time = *t; - dt = date_n_time( &install_time, &date_len ); - if (date_len != 8 && date_len != 11) { - snmp_log(LOG_ERR, "Bogus length from date_n_time for %s", entry->swName); -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c 2017-08-11 00:17:07.488544492 +0200 -@@ -484,9 +484,9 @@ + #endif + entry->swType = (g && NULL != strstr( g, "System Environment")) + ? 2 /* operatingSystem */ +diff -Nurp net-snmp-5.8-orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.8/agent/mibgroup/host/hr_swinst.c +--- net-snmp-5.8-orig/agent/mibgroup/host/hr_swinst.c 2018-10-10 09:45:14.907075076 +0000 ++++ net-snmp-5.8/agent/mibgroup/host/hr_swinst.c 2018-10-10 19:34:48.935596621 +0000 +@@ -479,9 +479,9 @@ var_hrswinst(struct variable * vp, } #else # ifdef HAVE_LIBRPM @@ -52,7 +48,7 @@ long_return = 2; /* operatingSystem */ else long_return = 4; /* applcation */ -@@ -503,9 +503,8 @@ +@@ -498,9 +498,8 @@ var_hrswinst(struct variable * vp, case HRSWINST_DATE: { #ifdef HAVE_LIBRPM @@ -64,16 +60,16 @@ ret = date_n_time(&installTime, var_len); } else { ret = date_n_time(NULL, var_len); -@@ -665,7 +664,7 @@ +@@ -660,7 +659,7 @@ Save_HR_SW_info(int ix) if (1 <= ix && ix <= swi->swi_nrec && ix != swi->swi_prevx) { int offset; Header h; - char *n, *v, *r; -+ const char *n, *v, *r; ++ const char *n, *v, *r; offset = swi->swi_recs[ix - 1]; -@@ -690,11 +689,9 @@ +@@ -685,11 +684,9 @@ Save_HR_SW_info(int ix) swi->swi_h = h; swi->swi_prevx = ix; ++++++ net-snmp-5.7.3-net-snmp-config-headercheck.patch -> net-snmp-5.8-net-snmp-config-headercheck.patch ++++++ --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3-net-snmp-config-headercheck.patch 2015-07-21 13:26:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8-net-snmp-config-headercheck.patch 2018-10-25 08:11:08.368235276 +0200 @@ -1,7 +1,6 @@ -Index: net-snmp-5.7.2/net-snmp-config.in -=================================================================== ---- net-snmp-5.7.2.orig/net-snmp-config.in -+++ net-snmp-5.7.2/net-snmp-config.in +diff -Nurp net-snmp-5.8-orig/net-snmp-config.in net-snmp-5.8/net-snmp-config.in +--- net-snmp-5.8-orig/net-snmp-config.in 2018-10-10 09:45:14.947075442 +0000 ++++ net-snmp-5.8/net-snmp-config.in 2018-10-10 09:48:04.792631474 +0000 @@ -41,6 +41,14 @@ count() echo $# } @@ -17,7 +16,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ -@@ -138,9 +146,11 @@ else +@@ -140,9 +148,11 @@ else ;; #################################################### compile --base-cflags) @@ -29,7 +28,7 @@ echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} ;; --srcdir) -@@ -151,6 +161,7 @@ else +@@ -153,6 +163,7 @@ else echo $NSC_LIBDIR ;; --ldflags|--ld*) @@ -37,7 +36,7 @@ echo $NSC_LDFLAGS ;; --build-lib-dirs) -@@ -188,29 +199,37 @@ else +@@ -190,29 +201,37 @@ else #################################################### client lib --libs) # use this one == --netsnmp-libs + --external-libs @@ -75,7 +74,7 @@ echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS ;; #################################################### -@@ -236,6 +255,7 @@ else +@@ -238,6 +257,7 @@ else #################################################### --compile-subagent) ++++++ net-snmp-5.7.3-netgroups.patch -> net-snmp-5.8-netgroups.patch ++++++ --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3-netgroups.patch 2015-07-21 13:26:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8-netgroups.patch 2018-10-25 08:11:08.388235263 +0200 @@ -1,16 +1,16 @@ -diff -Nurp net-snmp-5.7.3.orig/configure.d/config_os_functions net-snmp-5.7.3/configure.d/config_os_functions ---- net-snmp-5.7.3.orig/configure.d/config_os_functions 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/configure.d/config_os_functions 2015-07-16 10:32:15.159643068 +0200 -@@ -31,11 +31,12 @@ AC_CHECK_FUNCS([lrand48 rand - [signal sigset ] ) +diff -Nurp net-snmp-5.8-orig/configure.d/config_os_functions net-snmp-5.8/configure.d/config_os_functions +--- net-snmp-5.8-orig/configure.d/config_os_functions 2018-10-10 09:45:14.899075003 +0000 ++++ net-snmp-5.8/configure.d/config_os_functions 2018-10-10 10:06:55.326988809 +0000 +@@ -37,11 +37,12 @@ AC_CHECK_FUNCS([rand random srand sran # Library: --AC_CHECK_FUNCS([closedir fgetc_unlocked flockfile ] dnl + AC_CHECK_FUNCS([asprintf ] dnl +- [closedir fgetc_unlocked flockfile ] dnl - [fork funlockfile getipnodebyname ] dnl - [gettimeofday if_nametoindex mkstemp ] dnl - [opendir readdir regcomp ] dnl - [setenv setitimer setlocale ] dnl -+AC_CHECK_FUNCS([closedir endnetgrent fgetc_unlocked ] dnl ++ [closedir endnetgrent fgetc_unlocked ] dnl + [flockfile fork funlockfile ] dnl + [getipnodebyname getnetgrent gettimeofday ] dnl + [if_nametoindex mkstemp opendir ] dnl @@ -19,10 +19,10 @@ [setsid snprintf strcasestr ] dnl [strdup strerror strncasecmp ] dnl [sysconf times vsnprintf ] ) -diff -Nurp net-snmp-5.7.3.orig/man/snmpd.conf.5.def net-snmp-5.7.3/man/snmpd.conf.5.def ---- net-snmp-5.7.3.orig/man/snmpd.conf.5.def 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/man/snmpd.conf.5.def 2015-07-16 10:41:34.337850287 +0200 -@@ -389,7 +389,14 @@ map an SNMPv1 or SNMPv2c community strin +diff -Nurp net-snmp-5.8-orig/man/snmpd.conf.5.def net-snmp-5.8/man/snmpd.conf.5.def +--- net-snmp-5.8-orig/man/snmpd.conf.5.def 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/man/snmpd.conf.5.def 2018-10-10 10:10:44.057084311 +0000 +@@ -390,7 +390,15 @@ map an SNMPv1 or SNMPv2c community strin a particular range of source addresses, or globally (\fI"default"\fR). A restricted source can either be a specific hostname (or address), or a subnet - represented as IP/MASK (e.g. 10.10.10.0/255.255.255.0), or @@ -35,252 +35,7 @@ +.IP +Note: The hostname DNS lookup and \fInetgroup\fR resolution is done only +during snmpd start or reload. - .IP - The same community string can be specified in several separate directives - (presumably with different source tokens), and the first source/community -diff -Nurp net-snmp-5.7.3.orig/snmplib/transports/snmpUDPDomain.c net-snmp-5.7.3/snmplib/transports/snmpUDPDomain.c ---- net-snmp-5.7.3.orig/snmplib/transports/snmpUDPDomain.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpUDPDomain.c 2015-07-16 10:32:15.160643078 +0200 -@@ -88,6 +88,11 @@ void _netsnmp_udp_sockopt_set(int fd, in - int - netsnmp_sockaddr_in2(struct sockaddr_in *addr, - const char *inpeername, const char *default_target); -+static void -+netsnmp_udp_com2SecList_add(char *secName, size_t secNameLen, -+ char *contextName, size_t contextNameLen, -+ char *community, size_t communityLen, -+ struct in_addr network, struct in_addr mask); - - /* - * Return a string representing the address in data, or else the "far end" -@@ -100,6 +105,59 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t - return netsnmp_ipv4_fmtaddr("UDP", t, data, len); - } - -+static int -+netsnmp_udp_resolve_source(char *source, struct in_addr *network, -+ struct in_addr *mask) -+{ -+ /* Split the source/netmask parts */ -+ char *strmask = strchr(source, '/'); -+ if (strmask != NULL) -+ /* Mask given. */ -+ *strmask++ = '\0'; -+ -+ /* Try interpreting as a dotted quad. */ -+ if (inet_pton(AF_INET, source, network) == 0) { -+ /* Nope, wasn't a dotted quad. Must be a hostname. */ -+ int ret = netsnmp_gethostbyname_v4(source, &(network->s_addr)); -+ if (ret < 0) { -+ config_perror("cannot resolve source hostname"); -+ return ret; -+ } -+ } -+ -+ /* Now work out the mask. */ -+ if (strmask == NULL || *strmask == '\0') { -+ /* No mask was given. Assume /32 */ -+ mask->s_addr = (in_addr_t)(~0UL); -+ } else { -+ /* Try to interpret mask as a "number of 1 bits". */ -+ char* cp; -+ long maskLen = strtol(strmask, &cp, 10); -+ if (*cp == '\0') { -+ if (0 < maskLen && maskLen <= 32) -+ mask->s_addr = htonl((in_addr_t)(~0UL << (32 - maskLen))); -+ else if (maskLen == 0) -+ mask->s_addr = 0; -+ else { -+ config_perror("bad mask length"); -+ return -1; -+ } -+ } -+ /* Try to interpret mask as a dotted quad. */ -+ else if (inet_pton(AF_INET, strmask, mask) == 0) { -+ config_perror("bad mask"); -+ return -1; -+ } -+ -+ /* Check that the network and mask are consistent. */ -+ if (network->s_addr & ~mask->s_addr) { -+ config_perror("source/mask mismatch"); -+ return -1; -+ } -+ } -+ return 0; -+} -+ - - #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR) - -@@ -259,102 +317,85 @@ netsnmp_udp_parse_security(const char *t - if (strcmp(source, "default") == 0) { - network.s_addr = 0; - mask.s_addr = 0; -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } else { -- /* Split the source/netmask parts */ -- char *strmask = strchr(source, '/'); -- if (strmask != NULL) -- /* Mask given. */ -- *strmask++ = '\0'; -- -- /* Try interpreting as a dotted quad. */ -- if (inet_pton(AF_INET, source, &network) == 0) { -- /* Nope, wasn't a dotted quad. Must be a hostname. */ -- int ret = netsnmp_gethostbyname_v4(source, &network.s_addr); -- if (ret < 0) { -- config_perror("cannot resolve source hostname"); -- return; -- } -- } -- -- /* Now work out the mask. */ -- if (strmask == NULL || *strmask == '\0') { -- /* No mask was given. Assume /32 */ -- mask.s_addr = (in_addr_t)(~0UL); -- } else { -- /* Try to interpret mask as a "number of 1 bits". */ -- char* cp; -- long maskLen = strtol(strmask, &cp, 10); -- if (*cp == '\0') { -- if (0 < maskLen && maskLen <= 32) -- mask.s_addr = htonl((in_addr_t)(~0UL << (32 - maskLen))); -- else if (maskLen == 0) -- mask.s_addr = 0; -- else { -- config_perror("bad mask length"); -- return; -+#if HAVE_ENDNETGRENT && HAVE_GETNETGRENT && HAVE_SETNETGRENT -+ /* Interpret as netgroup */ -+ if (*source == '@') { -+ char *netgroup = source+1; -+ char *host, *user, *domain; -+ setnetgrent(netgroup); -+ while (getnetgrent(&host, &user, &domain)) { -+ if (netsnmp_udp_resolve_source(host, &network, &mask) == 0) { -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } - } -- /* Try to interpret mask as a dotted quad. */ -- else if (inet_pton(AF_INET, strmask, &mask) == 0) { -- config_perror("bad mask"); -- return; -- } -- -- /* Check that the network and mask are consistent. */ -- if (network.s_addr & ~mask.s_addr) { -- config_perror("source/mask mismatch"); -- return; -+ endnetgrent(); -+ } -+ /* Without '@' it has to be an address or hostname */ -+ else -+#endif -+ { -+ if (netsnmp_udp_resolve_source(source, &network, &mask) == 0) { -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } - } - } -+} - -- { -- void* v = malloc(offsetof(com2SecEntry, community) + communityLen + -- secNameLen + contextNameLen); -- -- com2SecEntry* e = (com2SecEntry*)v; -- char* last = ((char*)v) + offsetof(com2SecEntry, community); -+static void -+netsnmp_udp_com2SecList_add(char *secName, size_t secNameLen, char *contextName, -+ size_t contextNameLen, char *community, size_t communityLen, -+ struct in_addr network, struct in_addr mask) -+{ -+ void *v = malloc(offsetof(com2SecEntry, community) + communityLen + -+ secNameLen + contextNameLen); - -- if (v == NULL) { -- config_perror("memory error"); -- return; -- } -+ com2SecEntry* e = (com2SecEntry*)v; -+ char* last = ((char*)v) + offsetof(com2SecEntry, community); - -- /* -- * Everything is okay. Copy the parameters to the structure allocated -- * above and add it to END of the list. -- */ -+ if (v == NULL) { -+ config_perror("memory error"); -+ return; -+ } - -- { -- char buf1[INET_ADDRSTRLEN]; -- char buf2[INET_ADDRSTRLEN]; -- DEBUGMSGTL(("netsnmp_udp_parse_security", -- "<\"%s\", %s/%s> => \"%s\"\n", community, -- inet_ntop(AF_INET, &network, buf1, sizeof(buf1)), -- inet_ntop(AF_INET, &mask, buf2, sizeof(buf2)), -- secName)); -- } -+ /* -+ * Everything is okay. Copy the parameters to the structure allocated -+ * above and add it to END of the list. -+ */ - -- memcpy(last, community, communityLen); -- last += communityLen; -- memcpy(last, secName, secNameLen); -- e->secName = last; -- last += secNameLen; -- if (contextNameLen) { -- memcpy(last, contextName, contextNameLen); -- e->contextName = last; -- } else -- e->contextName = last - 1; -- e->network = network.s_addr; -- e->mask = mask.s_addr; -- e->next = NULL; -- -- if (com2SecListLast != NULL) { -- com2SecListLast->next = e; -- com2SecListLast = e; -- } else { -- com2SecListLast = com2SecList = e; -- } -+ { -+ char buf1[INET_ADDRSTRLEN]; -+ char buf2[INET_ADDRSTRLEN]; -+ DEBUGMSGTL(("netsnmp_udp_parse_security", -+ "<\"%s\", %s/%s> => \"%s\"\n", community, -+ inet_ntop(AF_INET, &network, buf1, sizeof(buf1)), -+ inet_ntop(AF_INET, &mask, buf2, sizeof(buf2)), -+ secName)); -+ } -+ -+ memcpy(last, community, communityLen); -+ last += communityLen; -+ memcpy(last, secName, secNameLen); -+ e->secName = last; -+ last += secNameLen; -+ if (contextNameLen) { -+ memcpy(last, contextName, contextNameLen); -+ e->contextName = last; -+ } else -+ e->contextName = last - 1; -+ e->network = network.s_addr; -+ e->mask = mask.s_addr; -+ e->next = NULL; -+ -+ if (com2SecListLast != NULL) { -+ com2SecListLast->next = e; -+ com2SecListLast = e; -+ } else { -+ com2SecListLast = com2SecList = e; - } - } - ++.IP + A restriction preceded by an exclamation mark (!) denies access from + that address or subnet, e.g., !10.10.10.0/24 denies requests from + that sources in that subnet. Deny restrictions must be before ++++++ net-snmp-5.7.3-perl-tk-warning.patch -> net-snmp-5.8-perl-tk-warning.patch ++++++ ++++++ net-snmp-5.7.3-pie.patch -> net-snmp-5.8-pie.patch ++++++ --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3-pie.patch 2015-07-21 13:26:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8-pie.patch 2018-10-25 08:11:08.424235240 +0200 @@ -1,8 +1,7 @@ -Index: net-snmp-5.7.2/agent/Makefile.in -=================================================================== ---- net-snmp-5.7.2.orig/agent/Makefile.in -+++ net-snmp-5.7.2/agent/Makefile.in -@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c +diff -Nurp net-snmp-5.8-orig/agent/Makefile.in net-snmp-5.8/agent/Makefile.in +--- net-snmp-5.8-orig/agent/Makefile.in 2018-10-10 20:12:33.288508471 +0000 ++++ net-snmp-5.8/agent/Makefile.in 2018-10-10 20:12:13.236322553 +0000 +@@ -297,7 +297,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) @@ -11,11 +10,10 @@ libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS) $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@ -Index: net-snmp-5.7.2/apps/Makefile.in -=================================================================== ---- net-snmp-5.7.2.orig/apps/Makefile.in -+++ net-snmp-5.7.2/apps/Makefile.in -@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX +diff -Nurp net-snmp-5.8-orig/apps/Makefile.in net-snmp-5.8/apps/Makefile.in +--- net-snmp-5.8-orig/apps/Makefile.in 2018-10-10 20:10:23.983309589 +0000 ++++ net-snmp-5.8/apps/Makefile.in 2018-10-10 20:11:50.172108708 +0000 +@@ -183,7 +183,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS} snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) ++++++ net-snmp-5.7.3-snmpstatus-suppress-output.patch -> net-snmp-5.8-snmpstatus-suppress-output.patch ++++++ --- /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3-snmpstatus-suppress-output.patch 2015-07-21 13:26:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8-snmpstatus-suppress-output.patch 2018-10-25 08:11:08.444235226 +0200 @@ -1,6 +1,6 @@ -diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus.c ---- net-snmp-5.7.3.orig/apps/snmpstatus.c 2015-07-14 22:06:08.938851077 +0200 -+++ net-snmp-5.7.3/apps/snmpstatus.c 2015-07-14 22:06:23.905980889 +0200 +diff -Nurp net-snmp-5.8-orig/apps/snmpstatus.c net-snmp-5.8/apps/snmpstatus.c +--- net-snmp-5.8-orig/apps/snmpstatus.c 2018-10-10 09:45:14.955075516 +0000 ++++ net-snmp-5.8/apps/snmpstatus.c 2018-10-10 10:15:16.131576910 +0000 @@ -96,6 +96,15 @@ size_t length_ipOutRequests = #define NETSNMP_DS_APP_DONT_FIX_PDUS 0 @@ -53,14 +53,14 @@ } -@@ -152,7 +183,7 @@ main(int argc, char *argv[]) +@@ -154,7 +185,7 @@ main(int argc, char *argv[]) /* * get the common command line arguments */ - switch (snmp_parse_args(argc, argv, &session, "C:", &optProc)) { + switch (snmp_parse_args(argc, argv, &session, "C:S:", &optProc)) { case NETSNMP_PARSE_ARGS_ERROR: - exit(1); + goto out; case NETSNMP_PARSE_ARGS_SUCCESS_EXIT: @@ -185,8 +216,10 @@ main(int argc, char *argv[]) pdu = snmp_pdu_create(SNMP_MSG_GET); @@ -75,7 +75,7 @@ /* * do the request -@@ -278,6 +311,10 @@ main(int argc, char *argv[]) +@@ -279,6 +312,10 @@ main(int argc, char *argv[]) if (response) snmp_free_pdu(response); @@ -86,7 +86,7 @@ /* * create PDU for GET request and add object names to request */ -@@ -375,11 +412,11 @@ main(int argc, char *argv[]) +@@ -386,11 +423,11 @@ main(int argc, char *argv[]) } printf("Interfaces: %d, Recv/Trans packets: %d/%d | IP: %d/%d\n", interfaces, ipackets, opackets, ipin, ipout); @@ -98,11 +98,11 @@ - + done: snmp_close(ss); - SOCK_CLEANUP; - return exitval; -diff -Nurp net-snmp-5.7.3.orig/man/snmpstatus.1.def net-snmp-5.7.3/man/snmpstatus.1.def ---- net-snmp-5.7.3.orig/man/snmpstatus.1.def 2015-07-14 22:06:08.838850210 +0200 -+++ net-snmp-5.7.3/man/snmpstatus.1.def 2015-07-14 22:13:19.891588792 +0200 + + out: +diff -Nurp net-snmp-5.8-orig/man/snmpstatus.1.def net-snmp-5.8/man/snmpstatus.1.def +--- net-snmp-5.8-orig/man/snmpstatus.1.def 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/man/snmpstatus.1.def 2018-10-10 10:15:16.131576910 +0000 @@ -32,7 +32,7 @@ snmpstatus - retrieves a fixed set of management information from a network entity .SH SYNOPSIS ++++++ net-snmp-5.7.3-socket-path.patch -> net-snmp-5.8-socket-path.patch ++++++ ++++++ net-snmp-5.7.3-testing-empty-arptable.patch -> net-snmp-5.8-testing-empty-arptable.patch ++++++ ++++++ net-snmp-5.7.3-velocity-mib.patch -> net-snmp-5.8-velocity-mib.patch ++++++ ++++++ net-snmp-5.7.3.tar.gz -> net-snmp-5.8.tar.gz ++++++ /work/SRC/openSUSE:Factory/net-snmp/net-snmp-5.7.3.tar.gz /work/SRC/openSUSE:Factory/.net-snmp.new/net-snmp-5.8.tar.gz differ: char 5, line 1
