diff --git a/net-snmp-5.8-fix-Makefile.PL.patch b/net-snmp-5.8-fix-Makefile.PL.patch index a8945c1..c52ecad 100644 --- a/net-snmp-5.8-fix-Makefile.PL.patch +++ b/net-snmp-5.8-fix-Makefile.PL.patch @@ -1,7 +1,8 @@ -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; +Index: net-snmp-5.9/perl/ASN/Makefile.PL +=================================================================== +--- net-snmp-5.9.orig/perl/ASN/Makefile.PL ++++ net-snmp-5.9/perl/ASN/Makefile.PL +@@ -9,6 +9,7 @@ use Config; use MakefileSubs; my $lib_version; @@ -9,14 +10,15 @@ diff -Nurp net-snmp-5.8-orig/perl/ASN/Makefile.PL net-snmp-5.8/perl/ASN/Makefile # 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 +Index: net-snmp-5.9/perl/Makefile.PL +=================================================================== +--- net-snmp-5.9.orig/perl/Makefile.PL ++++ net-snmp-5.9/perl/Makefile.PL @@ -4,6 +4,7 @@ use ExtUtils::MakeMaker; use Config; require 5; use MakefileSubs; +my %MakeParams = (); - WriteMakefile(TopLevelInitMakeParams()); - + # Prevent that MakeMaker complains about unknown parameter names. + NetSNMPGetOpts(); diff --git a/net-snmp-5.8-fix-python3.patch b/net-snmp-5.8-fix-python3.patch deleted file mode 100644 index 8ad8126..0000000 --- a/net-snmp-5.8-fix-python3.patch +++ /dev/null @@ -1,578 +0,0 @@ -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: diff --git a/net-snmp-5.8-netgroups.patch b/net-snmp-5.8-netgroups.patch deleted file mode 100644 index 3167524..0000000 --- a/net-snmp-5.8-netgroups.patch +++ /dev/null @@ -1,41 +0,0 @@ -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([asprintf ] dnl -- [closedir fgetc_unlocked flockfile ] dnl -- [fork funlockfile getipnodebyname ] dnl -- [gettimeofday if_nametoindex mkstemp ] dnl -- [opendir readdir regcomp ] dnl -- [setenv setitimer setlocale ] dnl -+ [closedir endnetgrent fgetc_unlocked ] dnl -+ [flockfile fork funlockfile ] dnl -+ [getipnodebyname getnetgrent gettimeofday ] dnl -+ [if_nametoindex mkstemp opendir ] dnl -+ [readdir regcomp setenv ] dnl -+ [setitimer setlocale setnetgrent ] dnl - [setsid snprintf strcasestr ] dnl - [strdup strerror strncasecmp ] dnl - [sysconf times vsnprintf ] ) -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 --IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. -+IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. It is also possible -+to reference a specific \fInetgroup\fR starting with an '@' character (e.g. -+@adminhosts). The \fInetgroup\fR lookup is running through the NSS (Name -+Services Switch) making it possible to define the group locally or via -+NIS/LDAP. -+.IP -+Note: The hostname DNS lookup and \fInetgroup\fR resolution is done only -+during snmpd start or reload. -+.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 diff --git a/net-snmp-5.8-pie.patch b/net-snmp-5.8-pie.patch index 86d4c1c..17648f4 100644 --- a/net-snmp-5.8-pie.patch +++ b/net-snmp-5.8-pie.patch @@ -1,6 +1,7 @@ -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 +Index: net-snmp-5.9/agent/Makefile.in +=================================================================== +--- net-snmp-5.9.orig/agent/Makefile.in ++++ net-snmp-5.9/agent/Makefile.in @@ -297,7 +297,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? @@ -9,11 +10,12 @@ diff -Nurp net-snmp-5.8-orig/agent/Makefile.in net-snmp-5.8/agent/Makefile.in + $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS} 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@ -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 + $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) @AGENTLIBS@ +Index: net-snmp-5.9/apps/Makefile.in +=================================================================== +--- net-snmp-5.9.orig/apps/Makefile.in ++++ net-snmp-5.9/apps/Makefile.in +@@ -190,7 +190,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS} snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) diff --git a/net-snmp-5.8.tar.gz b/net-snmp-5.8.tar.gz deleted file mode 100644 index 717d4f4..0000000 --- a/net-snmp-5.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf -size 6591680 diff --git a/net-snmp-5.9.tar.gz b/net-snmp-5.9.tar.gz new file mode 100644 index 0000000..b02380b --- /dev/null +++ b/net-snmp-5.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071 +size 6690435 diff --git a/net-snmp.changes b/net-snmp.changes index a1650b2..ad81e2c 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Mon Jan 18 21:31:18 UTC 2021 - Dirk Müller + +- update to 5.9: + snmplib: + - Add IPv6 support to DTLSUDP transport CHANGES: snmplib: use new + netsnmp_sockaddr_storage in netsnmp_addr_pair CHANGES: snmplib: add + base_transport ptr for tunneled transports + snmpd: + - Security vulnerabilty in the ping MIB reported by Christopher Ertl + from Microsoft fixed + - Changing to a different uid/gid can only be done once + - The extend mib is now read-only by default + snmptrap: + - BUG: 2899: Patch from Drew Roedersheimer to set library + engineboots/time values before sending + unspecified: + - Add pkg-config support for building applications and sub-agents Use + the netsnmp package when building Net-SNMP applications. Use the + netsnmp-agent package when building Net-SNMP subagents. +- drop net-snmp-5.8-fix-python3.patch, net-snmp-5.8-netgroups.patch: obsolete + ------------------------------------------------------------------- Sun Dec 13 12:58:00 UTC 2020 - diff --git a/net-snmp.spec b/net-snmp.spec index 8679878..f296488 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -1,7 +1,7 @@ # # spec file for package net-snmp # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -30,13 +30,13 @@ %define libname libsnmp30 %bcond_without python2 Name: net-snmp -Version: 5.8 +Version: 5.9 Release: 0 Summary: SNMP Daemon License: BSD-3-Clause AND MIT Group: Productivity/Networking/Other -URL: http://sourceforge.net/projects/net-snmp -Source: http://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/%{name}-%{version}.tar.gz +URL: https://sourceforge.net/projects/net-snmp +Source: https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/%{name}-%{version}.tar.gz Source1: snmpd.service Source2: snmpd.conf Source3: README.SUSE @@ -54,17 +54,16 @@ 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 Patch12: net-snmp-5.8-add-lustre-fs-support.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool +BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: procps BuildRequires: python-rpm-macros @@ -267,7 +266,7 @@ autoreconf -fvi --with-systemd # Parallel build deps not properly stated -make -j1 +%make_build -j1 pushd python %python_exec setup.py build --basedir="../" @@ -301,7 +300,7 @@ install -D -m 0644 %{SOURCE10} %{buildroot}%{_fillupdir}/sysconfig.snmpd install -D -m 0644 %{SOURCE11} %{buildroot}%{_fillupdir}/sysconfig.snmptrapd # tmpfiles install -m 755 -d %{buildroot}/%{_tmpfilesdir} -install -m 644 %SOURCE20 %{buildroot}/%{_tmpfilesdir}/net-snmp.conf +install -m 644 %{SOURCE20} %{buildroot}/%{_tmpfilesdir}/net-snmp.conf # ln -s -f %{netsnmp_agentx_socket_dir_fhs} %{buildroot}%{netsnmp_agentx_socket_dir_rfc} # @@ -399,6 +398,8 @@ find %{buildroot} -type f -name "*.la" -delete -print %{_includedir}/net-snmp %{_libdir}/libsnmp*.so %{_libdir}/libnetsnmp*.so +%{_libdir}/pkgconfig/netsnmp-agent.pc +%{_libdir}/pkgconfig/netsnmp.pc %{_bindir}/mib2c %{_bindir}/mib2c-update %{_datadir}/snmp/mib2c*