Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-dnslib for openSUSE:Factory checked in at 2022-01-23 18:38:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dnslib (Old) and /work/SRC/openSUSE:Factory/.python-dnslib.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dnslib" Sun Jan 23 18:38:45 2022 rev:4 rq:948249 version:0.9.19 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dnslib/python-dnslib.changes 2022-01-15 20:05:29.093772342 +0100 +++ /work/SRC/openSUSE:Factory/.python-dnslib.new.1938/python-dnslib.changes 2022-01-23 18:38:49.513891674 +0100 @@ -1,0 +2,6 @@ +Sun Jan 23 16:53:04 UTC 2022 - Dirk M??ller <[email protected]> + +- update to 0.9.19: + * Allow custom log function (logf) in DNSLogger + +------------------------------------------------------------------- Old: ---- dnslib-0.9.18.tar.gz New: ---- dnslib-0.9.19.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dnslib.spec ++++++ --- /var/tmp/diff_new_pack.uA69Ne/_old 2022-01-23 18:38:50.925882174 +0100 +++ /var/tmp/diff_new_pack.uA69Ne/_new 2022-01-23 18:38:50.933882120 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-dnslib -Version: 0.9.18 +Version: 0.9.19 Release: 0 Summary: Simple library to encode/decode DNS wire-format packets License: BSD-2-Clause ++++++ dnslib-0.9.18.tar.gz -> dnslib-0.9.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/PKG-INFO new/dnslib-0.9.19/PKG-INFO --- old/dnslib-0.9.18/PKG-INFO 2022-01-10 00:18:36.210179600 +0100 +++ new/dnslib-0.9.19/PKG-INFO 2022-01-17 23:22:18.456132200 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dnslib -Version: 0.9.18 +Version: 0.9.19 Summary: Simple library to encode/decode DNS wire-format packets Home-page: https://github.com/paulc/dnslib Author: PaulC @@ -380,7 +380,8 @@ Merge pull request #17 from sunds/issue_16 Issue 16: uncaught exceptions leak open sockets * 0.9.18 2022-01-09 Validate TXID in client.py (Issue #30 - thanks to @daniel4x) - + * 0.9.19 2022-01-09 Allow custom log function (logf) in DNSLogger + (Issue #31 - trhanks to @DmitryFrolovTri) License: -------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/README new/dnslib-0.9.19/README --- old/dnslib-0.9.18/README 2022-01-10 00:17:21.000000000 +0100 +++ new/dnslib-0.9.19/README 2022-01-17 23:22:11.000000000 +0100 @@ -366,7 +366,8 @@ Merge pull request #17 from sunds/issue_16 Issue 16: uncaught exceptions leak open sockets * 0.9.18 2022-01-09 Validate TXID in client.py (Issue #30 - thanks to @daniel4x) - + * 0.9.19 2022-01-09 Allow custom log function (logf) in DNSLogger + (Issue #31 - trhanks to @DmitryFrolovTri) License: -------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/__init__.py new/dnslib-0.9.19/dnslib/__init__.py --- old/dnslib-0.9.18/dnslib/__init__.py 2022-01-10 00:17:03.000000000 +0100 +++ new/dnslib-0.9.19/dnslib/__init__.py 2022-01-17 23:22:02.000000000 +0100 @@ -368,7 +368,8 @@ Merge pull request #17 from sunds/issue_16 Issue 16: uncaught exceptions leak open sockets * 0.9.18 2022-01-09 Validate TXID in client.py (Issue #30 - thanks to @daniel4x) - + * 0.9.19 2022-01-09 Allow custom log function (logf) in DNSLogger + (Issue #31 - trhanks to @DmitryFrolovTri) License: -------- @@ -391,7 +392,7 @@ from dnslib.dns import * -version = "0.9.18" +version = "0.9.19" if __name__ == '__main__': import doctest,sys,textwrap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/fixedresolver.py new/dnslib-0.9.19/dnslib/fixedresolver.py --- old/dnslib-0.9.18/dnslib/fixedresolver.py 2020-05-31 16:39:09.000000000 +0200 +++ new/dnslib-0.9.19/dnslib/fixedresolver.py 2022-01-17 23:00:30.000000000 +0100 @@ -65,7 +65,7 @@ args.response = open(args.zonefile) resolver = FixedResolver(args.response) - logger = DNSLogger(args.log,args.log_prefix) + logger = DNSLogger(args.log,prefix=args.log_prefix) print("Starting Fixed Resolver (%s:%d) [%s]" % ( args.address or "*", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/proxy.py new/dnslib-0.9.19/dnslib/proxy.py --- old/dnslib-0.9.18/dnslib/proxy.py 2021-05-07 18:06:41.000000000 +0200 +++ new/dnslib-0.9.19/dnslib/proxy.py 2022-01-17 23:00:20.000000000 +0100 @@ -144,7 +144,7 @@ resolver = ProxyResolver(args.dns,args.dns_port,args.timeout) handler = PassthroughDNSHandler if args.passthrough else DNSHandler - logger = DNSLogger(args.log,args.log_prefix) + logger = DNSLogger(args.log,prefix=args.log_prefix) udp_server = DNSServer(resolver, port=args.port, address=args.address, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/server.py new/dnslib-0.9.19/dnslib/server.py --- old/dnslib-0.9.18/dnslib/server.py 2022-01-10 00:05:47.000000000 +0100 +++ new/dnslib-0.9.19/dnslib/server.py 2022-01-17 23:20:02.000000000 +0100 @@ -59,15 +59,33 @@ ;abc.def. IN A >>> server.stop() + DNSLogger accepts custom logging function (logf) + + >>> resolver = BaseResolver() + >>> logger = DNSLogger(prefix=False,logf=lambda s:print(s.upper())) + >>> server = DNSServer(resolver,port=8054,address="localhost",logger=logger) + >>> server.start_thread() + >>> q = DNSRecord.question("abc.def") + >>> a = q.send("localhost",8054) + REQUEST: [...] (UDP) / 'ABC.DEF.' (A) + REPLY: [...] (UDP) / 'ABC.DEF.' (A) / NXDOMAIN + >>> print(DNSRecord.parse(a)) + ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: ... + ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 + ;; QUESTION SECTION: + ;abc.def. IN A + >>> server.stop() + >>> class TestResolver: ... def resolve(self,request,handler): ... reply = request.reply() ... reply.add_answer(*RR.fromZone("abc.def. 60 A 1.2.3.4")) ... return reply >>> resolver = TestResolver() - >>> server = DNSServer(resolver,port=8053,address="localhost",logger=logger,tcp=True) + >>> logger = DNSLogger(prefix=False) + >>> server = DNSServer(resolver,port=8055,address="localhost",logger=logger,tcp=True) >>> server.start_thread() - >>> a = q.send("localhost",8053,tcp=True) + >>> a = q.send("localhost",8055,tcp=True) Request: [...] (tcp) / 'abc.def.' (A) Reply: [...] (tcp) / 'abc.def.' (A) / RRs: A >>> print(DNSRecord.parse(a)) @@ -194,9 +212,12 @@ log_truncated - Truncated log_error - Decoding error log_data - Dump full request/response + + A custom logging function can be passed to the constructor via the + `logf` parameter (defaults to print) """ - def __init__(self,log="",prefix=True): + def __init__(self,log="",prefix=True,logf=None): """ Selectively enable log hooks depending on log argument (comma separated list of hooks to enable/disable) @@ -207,6 +228,8 @@ - If entry doesn't start with +/- replace defaults Prefix argument enables/disables log prefix + + Logf argument sets log print function (defaults to print) """ default = ["request","reply","truncated","error"] log = log.split(",") if log else [] @@ -218,6 +241,7 @@ if l[4:] not in enabled: setattr(self,l,self.log_pass) self.prefix = prefix + self.logf = logf or print def log_pass(self,*args): pass @@ -231,7 +255,7 @@ return "" def log_recv(self,handler,data): - print("%sReceived: [%s:%d] (%s) <%d> : %s" % ( + self.logf("%sReceived: [%s:%d] (%s) <%d> : %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -240,7 +264,7 @@ binascii.hexlify(data))) def log_send(self,handler,data): - print("%sSent: [%s:%d] (%s) <%d> : %s" % ( + self.logf("%sSent: [%s:%d] (%s) <%d> : %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -249,7 +273,7 @@ binascii.hexlify(data))) def log_request(self,handler,request): - print("%sRequest: [%s:%d] (%s) / '%s' (%s)" % ( + self.logf("%sRequest: [%s:%d] (%s) / '%s' (%s)" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -260,7 +284,7 @@ def log_reply(self,handler,reply): if reply.header.rcode == RCODE.NOERROR: - print("%sReply: [%s:%d] (%s) / '%s' (%s) / RRs: %s" % ( + self.logf("%sReply: [%s:%d] (%s) / '%s' (%s) / RRs: %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -269,7 +293,7 @@ QTYPE[reply.q.qtype], ",".join([QTYPE[a.rtype] for a in reply.rr]))) else: - print("%sReply: [%s:%d] (%s) / '%s' (%s) / %s" % ( + self.logf("%sReply: [%s:%d] (%s) / '%s' (%s) / %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -280,7 +304,7 @@ self.log_data(reply) def log_truncated(self,handler,reply): - print("%sTruncated Reply: [%s:%d] (%s) / '%s' (%s) / RRs: %s" % ( + self.logf("%sTruncated Reply: [%s:%d] (%s) / '%s' (%s) / RRs: %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -291,7 +315,7 @@ self.log_data(reply) def log_error(self,handler,e): - print("%sInvalid Request: [%s:%d] (%s) :: %s" % ( + self.logf("%sInvalid Request: [%s:%d] (%s) :: %s" % ( self.log_prefix(handler), handler.client_address[0], handler.client_address[1], @@ -299,7 +323,7 @@ e)) def log_data(self,dnsobj): - print("\n",dnsobj.toZone(" "),"\n",sep="") + self.logf("\n%s\n" % (dnsobj.toZone(" "))) class UDPServer(socketserver.ThreadingMixIn,socketserver.UDPServer,object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/shellresolver.py new/dnslib-0.9.19/dnslib/shellresolver.py --- old/dnslib-0.9.18/dnslib/shellresolver.py 2020-05-31 16:39:09.000000000 +0200 +++ new/dnslib-0.9.19/dnslib/shellresolver.py 2022-01-17 23:00:38.000000000 +0100 @@ -83,7 +83,7 @@ args = p.parse_args() resolver = ShellResolver(args.map,args.origin,args.ttl) - logger = DNSLogger(args.log,args.log_prefix) + logger = DNSLogger(args.log,prefix=args.log_prefix) print("Starting Shell Resolver (%s:%d) [%s]" % ( args.address or "*", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib/zoneresolver.py new/dnslib-0.9.19/dnslib/zoneresolver.py --- old/dnslib-0.9.18/dnslib/zoneresolver.py 2020-05-31 16:39:09.000000000 +0200 +++ new/dnslib-0.9.19/dnslib/zoneresolver.py 2022-01-17 23:00:46.000000000 +0100 @@ -85,7 +85,7 @@ args.zone = open(args.zone) resolver = ZoneResolver(args.zone,args.glob) - logger = DNSLogger(args.log,args.log_prefix) + logger = DNSLogger(args.log,prefix=args.log_prefix) print("Starting Zone Resolver (%s:%d) [%s]" % ( args.address or "*", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnslib-0.9.18/dnslib.egg-info/PKG-INFO new/dnslib-0.9.19/dnslib.egg-info/PKG-INFO --- old/dnslib-0.9.18/dnslib.egg-info/PKG-INFO 2022-01-10 00:18:36.000000000 +0100 +++ new/dnslib-0.9.19/dnslib.egg-info/PKG-INFO 2022-01-17 23:22:18.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dnslib -Version: 0.9.18 +Version: 0.9.19 Summary: Simple library to encode/decode DNS wire-format packets Home-page: https://github.com/paulc/dnslib Author: PaulC @@ -380,7 +380,8 @@ Merge pull request #17 from sunds/issue_16 Issue 16: uncaught exceptions leak open sockets * 0.9.18 2022-01-09 Validate TXID in client.py (Issue #30 - thanks to @daniel4x) - + * 0.9.19 2022-01-09 Allow custom log function (logf) in DNSLogger + (Issue #31 - trhanks to @DmitryFrolovTri) License: --------
