Hello community,

here is the log from the commit of package python-pyrad for openSUSE:Leap:15.2 
checked in at 2020-03-23 17:26:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pyrad (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-pyrad.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pyrad"

Mon Mar 23 17:26:56 2020 rev:2 rq:787428 version:2.3

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pyrad/python-pyrad.changes      
2020-02-22 18:50:07.316440434 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.python-pyrad.new.3160/python-pyrad.changes    
2020-03-23 17:26:57.910174890 +0100
@@ -1,0 +2,7 @@
+Fri Mar 20 13:09:37 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to version 2.3
+  * Fixed #124 remove reuse_address=True from async server/client
+  * Fixed #121 Unknown attribute key error
+
+-------------------------------------------------------------------

Old:
----
  2.2.tar.gz

New:
----
  2.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pyrad.spec ++++++
--- /var/tmp/diff_new_pack.Vq7f0V/_old  2020-03-23 17:26:58.274175177 +0100
+++ /var/tmp/diff_new_pack.Vq7f0V/_new  2020-03-23 17:26:58.278175179 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pyrad
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pyrad
-Version:        2.2
+Version:        2.3
 Release:        0
 Summary:        RADIUS tools
 License:        BSD-3-Clause

++++++ 2.2.tar.gz -> 2.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/CHANGES.rst new/pyrad-2.3/CHANGES.rst
--- old/pyrad-2.2/CHANGES.rst   2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/CHANGES.rst   2020-02-06 00:24:03.000000000 +0100
@@ -1,6 +1,13 @@
 Changelog
 =========
 
+2.3 - Feb 6, 2020
+------------------
+
+* Fixed #124 remove reuse_address=True from async server/client
+
+* Fixed #121 Unknown attribute key error
+
 2.2 - Oct 19, 2019
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/LICENSE.txt new/pyrad-2.3/LICENSE.txt
--- old/pyrad-2.2/LICENSE.txt   2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/LICENSE.txt   2020-02-06 00:24:03.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright 2017-2019 Christian Giese. All rights reserved.
+Copyright 2017-2020 Christian Giese. All rights reserved.
 Copyright 2007-2008 Simplon. All rights reserved.
 Copyright 2002-2008 Wichert Akkerman. All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/docs/source/conf.py 
new/pyrad-2.3/docs/source/conf.py
--- old/pyrad-2.2/docs/source/conf.py   2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/docs/source/conf.py   2020-02-06 00:24:03.000000000 +0100
@@ -49,7 +49,7 @@
 
 # General information about the project.
 project = u'pyrad'
-copyright = u'Copyright 2002-2019 Wichert Akkerman and Christian Giese. All 
rights reserved.'
+copyright = u'Copyright 2002-2020 Wichert Akkerman and Christian Giese. All 
rights reserved.'
 author = u'Christian Giese <[email protected]>'
 
 # The version info for the project you're documenting, acts as replacement for
@@ -57,9 +57,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = u'2.2'
+version = u'2.3'
 # The full version, including alpha/beta/rc tags.
-release = u'2.2'
+release = u'2.3'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/example/auth.py 
new/pyrad-2.3/example/auth.py
--- old/pyrad-2.2/example/auth.py       2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/example/auth.py       2020-02-06 00:24:03.000000000 +0100
@@ -6,7 +6,7 @@
 import sys
 import pyrad.packet
 
-srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi", 
dict=Dictionary("dictionary"))
+srv = Client(server="127.0.0.1", secret=b"Kah3choteereethiejeimaeziecumi", 
dict=Dictionary("dictionary"))
 
 req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest, 
User_Name="wichert")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/example/dictionary 
new/pyrad-2.3/example/dictionary
--- old/pyrad-2.2/example/dictionary    2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/example/dictionary    2020-02-06 00:24:03.000000000 +0100
@@ -51,7 +51,7 @@
 #$INCLUDE dictionary.usr
 #$INCLUDE dictionary.versanet
 #$INCLUDE dictionary.erx
-#$INCLUDE dictionary.freeradius
+$INCLUDE dictionary.freeradius
 #$INCLUDE dictionary.alcatel
 
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/example/dictionary.freeradius 
new/pyrad-2.3/example/dictionary.freeradius
--- old/pyrad-2.2/example/dictionary.freeradius 1970-01-01 01:00:00.000000000 
+0100
+++ new/pyrad-2.3/example/dictionary.freeradius 2020-02-06 00:24:03.000000000 
+0100
@@ -0,0 +1,37 @@
+# -*- text -*-
+# Copyright (C) 2015 The FreeRADIUS Server project and contributors
+#
+#      The FreeRADIUS Vendor-Specific dictionary.
+#
+# Version:     $Id: ea468da88509aeff96b6f0d38ebc97411b9775b3 $
+#
+#      For a complete list of Private Enterprise Codes, see:
+#
+#      http://www.isi.edu/in-notes/iana/assignments/enterprise-numbers
+#
+
+VENDOR         FreeRADIUS                      11344
+
+BEGIN-VENDOR   FreeRADIUS
+
+#
+#  This attribute is really a bitmask.
+#
+ATTRIBUTE      FreeRADIUS-Statistics-Type              127     integer
+
+VALUE  FreeRADIUS-Statistics-Type      None                    0
+VALUE  FreeRADIUS-Statistics-Type      Authentication          1
+VALUE  FreeRADIUS-Statistics-Type      Accounting              2
+VALUE  FreeRADIUS-Statistics-Type      Proxy-Authentication    4
+VALUE  FreeRADIUS-Statistics-Type      Proxy-Accounting        8
+VALUE  FreeRADIUS-Statistics-Type      Internal                0x10
+VALUE  FreeRADIUS-Statistics-Type      Client                  0x20
+VALUE  FreeRADIUS-Statistics-Type      Server                  0x40
+VALUE  FreeRADIUS-Statistics-Type      Home-Server             0x80
+
+VALUE  FreeRADIUS-Statistics-Type      Auth-Acct               0x03
+VALUE  FreeRADIUS-Statistics-Type      Proxy-Auth-Acct         0x0c
+
+VALUE  FreeRADIUS-Statistics-Type      All                     0x1f
+
+END-VENDOR FreeRADIUS
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/example/server.py 
new/pyrad-2.3/example/server.py
--- old/pyrad-2.2/example/server.py     2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/example/server.py     2020-02-06 00:24:03.000000000 +0100
@@ -63,7 +63,7 @@
 
     # add clients (address, secret, name)
     srv.hosts["127.0.0.1"] = server.RemoteHost("127.0.0.1", 
b"Kah3choteereethiejeimaeziecumi", "localhost")
-    srv.BindToAddress("")
+    srv.BindToAddress("0.0.0.0")
 
     # start server
     srv.Run()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/example/status.py 
new/pyrad-2.3/example/status.py
--- old/pyrad-2.2/example/status.py     1970-01-01 01:00:00.000000000 +0100
+++ new/pyrad-2.3/example/status.py     2020-02-06 00:24:03.000000000 +0100
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+from __future__ import print_function
+from pyrad.client import Client
+from pyrad.dictionary import Dictionary
+import socket
+import sys
+import pyrad.packet
+
+srv = Client(server="localhost", authport=18121, secret=b"test", 
dict=Dictionary("dictionary"))
+
+req = srv.CreateAuthPacket(code=pyrad.packet.StatusServer)
+req["FreeRADIUS-Statistics-Type"] = "All"
+req.add_message_authenticator()
+
+try:
+    print("Sending FreeRADIUS status request")
+    reply = srv.SendPacket(req)
+except pyrad.client.Timeout:
+    print("RADIUS server does not reply")
+    sys.exit(1)
+except socket.error as error:
+    print("Network error: " + error[1])
+    sys.exit(1)
+
+print("Attributes returned by server:")
+for i in reply.keys():
+    print("%s: %s" % (i, reply[i]))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/pyrad/__init__.py 
new/pyrad-2.3/pyrad/__init__.py
--- old/pyrad-2.2/pyrad/__init__.py     2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/pyrad/__init__.py     2020-02-06 00:24:03.000000000 +0100
@@ -40,7 +40,7 @@
 
 __author__ = 'Christian Giese <[email protected]>'
 __url__ = 'http://pyrad.readthedocs.io/en/latest/?badge=latest'
-__copyright__ = 'Copyright 2002-2019 Wichert Akkerman and Christian Giese. All 
rights reserved.'
-__version__ = '2.2'
+__copyright__ = 'Copyright 2002-2020 Wichert Akkerman and Christian Giese. All 
rights reserved.'
+__version__ = '2.3'
 
 __all__ = ['client', 'dictionary', 'packet', 'server', 'tools', 'dictfile']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/pyrad/client_async.py 
new/pyrad-2.3/pyrad/client_async.py
--- old/pyrad-2.2/pyrad/client_async.py 2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/pyrad/client_async.py 2020-02-06 00:24:03.000000000 +0100
@@ -241,7 +241,7 @@
 
             acct_connect = self.loop.create_datagram_endpoint(
                 self.protocol_acct,
-                reuse_address=True, reuse_port=True,
+                reuse_port=True,
                 remote_addr=(self.server, self.acct_port),
                 local_addr=bind_addr
             )
@@ -261,7 +261,7 @@
 
             auth_connect = self.loop.create_datagram_endpoint(
                 self.protocol_auth,
-                reuse_address=True, reuse_port=True,
+                reuse_port=True,
                 remote_addr=(self.server, self.auth_port),
                 local_addr=bind_addr
             )
@@ -281,7 +281,7 @@
 
             coa_connect = self.loop.create_datagram_endpoint(
                 self.protocol_coa,
-                reuse_address=True, reuse_port=True,
+                reuse_port=True,
                 remote_addr=(self.server, self.coa_port),
                 local_addr=bind_addr
             )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/pyrad/packet.py 
new/pyrad-2.3/pyrad/packet.py
--- old/pyrad-2.2/pyrad/packet.py       2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/pyrad/packet.py       2020-02-06 00:24:03.000000000 +0100
@@ -456,7 +456,8 @@
     def _PktEncodeAttributes(self):
         result = six.b('')
         for (code, datalst) in self.items():
-            if self.dict.attributes[self._DecodeKey(code)].type == 'tlv':
+            attribute = self.dict.attributes.get(self._DecodeKey(code))
+            if attribute and attribute.type == 'tlv':
                 result += self._PktEncodeTlv(code, datalst)
             else:
                 for data in datalst:
@@ -469,24 +470,24 @@
         if len(data) < 6:
             return [(26, data)]
 
-        (vendor, type, length) = struct.unpack('!LBB', data[:6])[0:3]
-
+        (vendor, atype, length) = struct.unpack('!LBB', data[:6])[0:3]
+        attribute = self.dict.attributes.get(self._DecodeKey((vendor, atype)))
         try:
-            if self.dict.attributes[self._DecodeKey((vendor, type))].type == 
'tlv':
-                self._PktDecodeTlvAttribute((vendor, type), data[6:length + 4])
+            if attribute and attribute.type == 'tlv':
+                self._PktDecodeTlvAttribute((vendor, atype), data[6:length + 
4])
                 tlvs = []  # tlv is added to the packet inside 
_PktDecodeTlvAttribute
             else:
-                tlvs = [((vendor, type), data[6:length + 4])]
+                tlvs = [((vendor, atype), data[6:length + 4])]
         except:
             return [(26, data)]
 
         sumlength = 4 + length
         while len(data) > sumlength:
             try:
-                type, length = struct.unpack('!BB', 
data[sumlength:sumlength+2])[0:2]
+                atype, length = struct.unpack('!BB', 
data[sumlength:sumlength+2])[0:2]
             except:
                 return [(26, data)]
-            tlvs.append(((vendor, type), data[sumlength+2:sumlength+length]))
+            tlvs.append(((vendor, atype), data[sumlength+2:sumlength+length]))
             sumlength += length
         return tlvs
 
@@ -495,8 +496,8 @@
         loc = 0
 
         while loc < len(data):
-            type, length = struct.unpack('!BB', data[loc:loc+2])[0:2]
-            sub_attributes.setdefault(type, []).append(data[loc+2:loc+length])
+            atype, length = struct.unpack('!BB', data[loc:loc+2])[0:2]
+            sub_attributes.setdefault(atype, []).append(data[loc+2:loc+length])
             loc += length
 
     def DecodePacket(self, packet):
@@ -531,6 +532,7 @@
                         'Attribute length is too small (%d)' % attrlen)
 
             value = packet[2:attrlen]
+            attribute = self.dict.attributes.get(self._DecodeKey(key))
             if key == 26:
                 for (key, value) in self._PktDecodeVendorAttribute(value):
                     self.setdefault(key, []).append(value)
@@ -538,8 +540,7 @@
                 # POST: Message Authenticator AVP is present.
                 self.message_authenticator = True
                 self.setdefault(key, []).append(value)
-
-            elif self.dict.attributes[self._DecodeKey(key)].type == 'tlv':
+            elif attribute and attribute.type == 'tlv':
                 self._PktDecodeTlvAttribute(key,value)
             else:
                 self.setdefault(key, []).append(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyrad-2.2/pyrad/server_async.py 
new/pyrad-2.3/pyrad/server_async.py
--- old/pyrad-2.2/pyrad/server_async.py 2019-10-19 23:48:43.000000000 +0200
+++ new/pyrad-2.3/pyrad/server_async.py 2020-02-06 00:24:03.000000000 +0100
@@ -243,7 +243,7 @@
                 bind_addr = (addr, self.acct_port)
                 acct_connect = self.loop.create_datagram_endpoint(
                     protocol_acct,
-                    reuse_address=True, reuse_port=True,
+                    reuse_port=True,
                     local_addr=bind_addr
                 )
                 self.acct_protocols.append(protocol_acct)
@@ -262,7 +262,7 @@
 
                 auth_connect = self.loop.create_datagram_endpoint(
                     protocol_auth,
-                    reuse_address=True, reuse_port=True,
+                    reuse_port=True,
                     local_addr=bind_addr
                 )
                 self.auth_protocols.append(protocol_auth)
@@ -281,7 +281,7 @@
 
                 coa_connect = self.loop.create_datagram_endpoint(
                     protocol_coa,
-                    reuse_address=True, reuse_port=True,
+                    reuse_port=True,
                     local_addr=bind_addr
                 )
                 self.coa_protocols.append(protocol_coa)


Reply via email to