Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package dnsdiag for openSUSE:Factory checked in at 2021-05-15 23:16:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dnsdiag (Old) and /work/SRC/openSUSE:Factory/.dnsdiag.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dnsdiag" Sat May 15 23:16:29 2021 rev:5 rq:893342 version:2.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/dnsdiag/dnsdiag.changes 2021-04-06 17:32:46.995327462 +0200 +++ /work/SRC/openSUSE:Factory/.dnsdiag.new.2988/dnsdiag.changes 2021-05-15 23:17:31.800413983 +0200 @@ -1,0 +2,25 @@ +Thu May 13 13:47:08 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to version 2.0.2 + * Bugfix release +- Update to version 2.0.1 + * Add support for DNSSEC + * Add -F to display flags for each response (dnsping) + * Display full response in verbose mode (dnsping) + * Add DoT (DNS over TLS) support (dnsping, dnseval) + * Add DoH (DNS over HTTPS) support (dnsping, dnseval) + * Add TCP support + * Improved JSON output support for dnseval + * Refactor and PEP8 cleanup + * Do not use system resolver when not needed + * Add support for user defined source IP address + * Add user-specified destination port (-p/--port) + * Improve error handling + * Display last response code for each entry + * Rework custom socket and custom TTL support + * Rework time calculation logic to eliminate an extra DNS + request that was just sent for timing (dnstraceroute) + * Update docs (output samples, use cases, etc) + * Use proper terminology (in code) to reduce confusion + +------------------------------------------------------------------- Old: ---- dnsdiag-2.0.0.tar.gz New: ---- dnsdiag-2.0.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dnsdiag.spec ++++++ --- /var/tmp/diff_new_pack.5oqn1M/_old 2021-05-15 23:17:32.280411520 +0200 +++ /var/tmp/diff_new_pack.5oqn1M/_new 2021-05-15 23:17:32.284411499 +0200 @@ -19,7 +19,7 @@ %bcond_without test Name: dnsdiag -Version: 2.0.0 +Version: 2.0.2 Release: 0 Summary: DNS request auditing toolset License: BSD-3-Clause ++++++ dnsdiag-2.0.0.tar.gz -> dnsdiag-2.0.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/PKG-INFO new/dnsdiag-2.0.2/PKG-INFO --- old/dnsdiag-2.0.0/PKG-INFO 2021-04-03 23:21:49.397770200 +0200 +++ new/dnsdiag-2.0.2/PKG-INFO 2021-05-13 13:49:19.896948300 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: dnsdiag -Version: 2.0.0 +Version: 2.0.2 Summary: DNS Measurement, Troubleshooting and Security Auditing Toolset (ping, traceroute) Home-page: https://dnsdiag.org/ Author: Babak Farrokhi @@ -18,7 +18,6 @@ Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/dnsdiag.egg-info/PKG-INFO new/dnsdiag-2.0.2/dnsdiag.egg-info/PKG-INFO --- old/dnsdiag-2.0.0/dnsdiag.egg-info/PKG-INFO 2021-04-03 23:21:49.000000000 +0200 +++ new/dnsdiag-2.0.2/dnsdiag.egg-info/PKG-INFO 2021-05-13 13:49:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: dnsdiag -Version: 2.0.0 +Version: 2.0.2 Summary: DNS Measurement, Troubleshooting and Security Auditing Toolset (ping, traceroute) Home-page: https://dnsdiag.org/ Author: Babak Farrokhi @@ -18,7 +18,6 @@ Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/dnsdiag.egg-info/requires.txt new/dnsdiag-2.0.2/dnsdiag.egg-info/requires.txt --- old/dnsdiag-2.0.0/dnsdiag.egg-info/requires.txt 2021-04-03 23:21:49.000000000 +0200 +++ new/dnsdiag-2.0.2/dnsdiag.egg-info/requires.txt 2021-05-13 13:49:19.000000000 +0200 @@ -1,4 +1,4 @@ dnspython>=1.16.0 cymruwhois>=1.6 -requests==2.21.0 +requests>=2.21.0 requests-toolbelt>=0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/dnseval.py new/dnsdiag-2.0.2/dnseval.py --- old/dnsdiag-2.0.0/dnseval.py 2021-04-03 21:14:04.000000000 +0200 +++ new/dnsdiag-2.0.2/dnseval.py 2021-05-13 13:42:12.000000000 +0200 @@ -36,11 +36,12 @@ import dns.rcode import dns.rdatatype import dns.resolver + import util.dns __author__ = 'Babak Farrokhi (ba...@farrokhi.net)' __license__ = 'BSD' -__version__ = '2.0.0' +__version__ = '2.0.2' __progname__ = os.path.basename(sys.argv[0]) from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, setup_signal_handler, flags_to_text @@ -58,14 +59,13 @@ self.N = '' self.R = '' self.G = '' - self.O = '' self.B = '' def usage(): print("""%s version %s -usage: %s [-ehmvCTXH] [-f server-list] [-c count] [-t type] [-p port] [-w wait] hostname +usage: %s [-ehmvCTXH] [-f server-list] [-j output.json] [-c count] [-t type] [-p port] [-w wait] hostname -h --help Show this help -f --file DNS server list to use (default: system resolvers) -c --count Number of requests to send (default: 10) @@ -74,6 +74,7 @@ -t --type DNS request record type (default: A) -T --tcp Use TCP instead of UDP -X --tls Use TLS as transport protocol + -j --json Save results as a JSON formatted file -H --doh Use HTTPS as transport protols (DoH) -p --port DNS server port number (default: 53 for TCP/UDP and 853 for TLS) -S --srcip Query source IP address @@ -105,7 +106,7 @@ waittime = 2 inputfilename = None fromfile = False - save_json = False + json_output = False use_edns = True want_dnssec = False force_miss = False @@ -114,8 +115,8 @@ qname = 'wikipedia.org' try: - opts, args = getopt.getopt(sys.argv[1:], "hf:c:t:w:S:TevCmXHD", - ["help", "file=", "count=", "type=", "wait=", "json", "tcp", "edns", "verbose", + opts, args = getopt.getopt(sys.argv[1:], "hf:c:t:w:S:TevCmXHDj:", + ["help", "file=", "count=", "type=", "wait=", "json=", "tcp", "edns", "verbose", "color", "force-miss", "srcip=", "tls", "doh", "dnssec"]) except getopt.GetoptError as err: print(err) @@ -145,7 +146,8 @@ elif o in ("-S", "--srcip"): src_ip = a elif o in ("-j", "--json"): - save_json = True + json_output = True + json_filename = a elif o in ("-e", "--edns"): use_edns = False elif o in ("-D", "--dnssec"): @@ -193,9 +195,11 @@ width = maxlen(f) blanks = (width - 5) * ' ' - print('server ', blanks, - ' avg(ms) min(ms) max(ms) stddev(ms) lost(%) ttl flags response') - print((104 + width) * '-') + + if not json_output: + print('server ', blanks, + ' avg(ms) min(ms) max(ms) stddev(ms) lost(%) ttl flags response') + print((104 + width) * '-') for server in f: # check if we have a valid dns server address @@ -239,29 +243,39 @@ l_color = color.O else: l_color = color.N - print("%s %-8.3f %-8.3f %-8.3f %-8.3f %s%%%-3d%s %-8s %21s %-20s" % ( - resolver, retval.r_avg, retval.r_min, retval.r_max, retval.r_stddev, l_color, retval.r_lost_percent, - color.N, s_ttl, text_flags, retval.rcode_text), flush=True) - if save_json: + if json_output: dns_data = { 'hostname': qname, 'timestamp': str(datetime.datetime.now()), 'r_min': retval.r_min, 'r_avg': retval.r_avg, - 'resolver': resolver, + 'resolver': resolver.rstrip(), 'r_max': retval.r_max, 'r_lost_percent': retval.r_lost_percent, 's_ttl': s_ttl, - 'text_flags': text_flags + 'text_flags': text_flags, + 'flags': retval.flags, + 'rcode': retval.rcode, + 'rcode_text': retval.rcode_text, } outer_data = { 'hostname': qname, 'data': dns_data } - with open('results.json', 'a+') as outfile: - json.dump(outer_data, outfile) - if verbose and retval.answer: + + if json_filename == '-': # stdout + print(json.dumps(outer_data, indent=2)) + else: + with open(json_filename, 'a+') as outfile: + json.dump(outer_data, outfile, indent=2) + + else: + print("%s %-8.3f %-8.3f %-8.3f %-8.3f %s%%%-3d%s %-8s %21s %-20s" % ( + resolver, retval.r_avg, retval.r_min, retval.r_max, retval.r_stddev, l_color, retval.r_lost_percent, + color.N, s_ttl, text_flags, retval.rcode_text), flush=True) + + if verbose and retval.answer and not json_output: ans_index = 1 for answer in retval.answer: print("Answer %d [ %s%s%s ]" % (ans_index, color.G, answer, color.N)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/dnsping.py new/dnsdiag-2.0.2/dnsping.py --- old/dnsdiag-2.0.0/dnsping.py 2021-04-03 18:56:18.000000000 +0200 +++ new/dnsdiag-2.0.2/dnsping.py 2021-05-13 13:42:12.000000000 +0200 @@ -39,11 +39,11 @@ import dns.flags import dns.resolver -from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, signal_handler, proto_to_text +from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, proto_to_text, unsupported_feature __author__ = 'Babak Farrokhi (ba...@farrokhi.net)' __license__ = 'BSD' -__version__ = '2.0.0' +__version__ = '2.0.2' __progname__ = os.path.basename(sys.argv[0]) shutdown = False @@ -212,17 +212,24 @@ try: stime = time.perf_counter() if proto is PROTO_UDP: - answers = dns.query.udp(query, dnsserver, timeout, dst_port, - src_ip, src_port, ignore_unexpected=True) + answers = dns.query.udp(query, dnsserver, timeout=timeout, port=dst_port, + source=src_ip, source_port=src_port, ignore_unexpected=True) elif proto is PROTO_TCP: - answers = dns.query.tcp(query, dnsserver, timeout, dst_port, - src_ip, src_port) + answers = dns.query.tcp(query, dnsserver, timeout=timeout, port=dst_port, + source=src_ip, source_port=src_port) elif proto is PROTO_TLS: - answers = dns.query.tls(query, dnsserver, timeout, dst_port, - src_ip, src_port) + if hasattr(dns.query, 'tls'): + answers = dns.query.tls(query, dnsserver, timeout, dst_port, + src_ip, src_port) + else: + unsupported_feature() + elif proto is PROTO_HTTPS: - answers = dns.query.https(query, dnsserver, timeout, dst_port, - src_ip, src_port) + if hasattr(dns.query, 'https'): + answers = dns.query.https(query, dnsserver, timeout, dst_port, + src_ip, src_port) + else: + unsupported_feature() etime = time.perf_counter() except dns.resolver.NoNameservers as e: @@ -251,7 +258,7 @@ response_time.append(elapsed) if not quiet: if show_flags: - flags = " [%s]" % dns.flags.to_text(answers.flags) + flags = " [%s] %s" % (dns.flags.to_text(answers.flags), dns.rcode.to_text(answers.rcode())) else: flags = "" print("%d bytes from %s: seq=%-3d time=%.3f ms%s" % ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/dnstraceroute.py new/dnsdiag-2.0.2/dnstraceroute.py --- old/dnsdiag-2.0.0/dnstraceroute.py 2021-04-03 18:56:18.000000000 +0200 +++ new/dnsdiag-2.0.2/dnstraceroute.py 2021-05-13 13:42:12.000000000 +0200 @@ -47,7 +47,7 @@ # Constants __author__ = 'Babak Farrokhi (ba...@farrokhi.net)' __license__ = 'BSD' -__version__ = '2.0.0' +__version__ = '2.0.2' __progname__ = os.path.basename(sys.argv[0]) @@ -60,7 +60,6 @@ N = '\033[m' # native R = '\033[31m' # red G = '\033[32m' # green - O = '\033[33m' # orange B = '\033[34m' # blue def __init__(self, mode): @@ -68,7 +67,6 @@ self.N = '' self.R = '' self.G = '' - self.O = '' self.B = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/setup.py new/dnsdiag-2.0.2/setup.py --- old/dnsdiag-2.0.0/setup.py 2021-04-03 18:56:18.000000000 +0200 +++ new/dnsdiag-2.0.2/setup.py 2021-05-13 13:42:12.000000000 +0200 @@ -2,17 +2,16 @@ setup( name="dnsdiag", - version="2.0.0", + version="2.0.2", packages=find_packages(), scripts=["dnseval.py", "dnsping.py", "dnstraceroute.py"], - install_requires=['dnspython>=1.16.0', 'cymruwhois>=1.6', 'requests==2.21.0', 'requests-toolbelt>=0.9.1'], + install_requires=['dnspython>=1.16.0', 'cymruwhois>=1.6', 'requests>=2.21.0', 'requests-toolbelt>=0.9.1'], classifiers=[ "Topic :: System :: Networking", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/util/dns.py new/dnsdiag-2.0.2/util/dns.py --- old/dnsdiag-2.0.0/util/dns.py 2021-04-03 18:56:18.000000000 +0200 +++ new/dnsdiag-2.0.2/util/dns.py 2021-05-13 11:17:22.000000000 +0200 @@ -28,7 +28,6 @@ import random import signal import socket -import string import sys from statistics import stdev @@ -38,6 +37,7 @@ import dns.rcode import dns.rdataclass import requests.exceptions +import string shutdown = False @@ -112,24 +112,31 @@ try: if proto is PROTO_UDP: - response = dns.query.udp(query, server, timeout, dst_port, src_ip, ignore_unexpected=True) + response = dns.query.udp(query, server, timeout=timeout, port=dst_port, source=src_ip, + ignore_unexpected=True) elif proto is PROTO_TCP: - response = dns.query.tcp(query, server, timeout, dst_port, src_ip) + response = dns.query.tcp(query, server, timeout=timeout, port=dst_port, source=src_ip) elif proto is PROTO_TLS: - response = dns.query.tls(query, server, timeout, dst_port, src_ip) + if hasattr(dns.query, 'tls'): + response = dns.query.tls(query, server, timeout, dst_port, src_ip) + else: + unsupported_feature() elif proto is PROTO_HTTPS: - response = dns.query.https(query, server, timeout, dst_port, src_ip) + if hasattr(dns.query, 'https'): + response = dns.query.https(query, server, timeout, dst_port, src_ip) + else: + unsupported_feature() except (requests.exceptions.ConnectTimeout, requests.exceptions.ReadTimeout, requests.exceptions.ConnectionError): raise ConnectionError('Connection failed') - except ValueError as e: + except ValueError: retval.rcode_text = "Invalid Response" break except dns.exception.Timeout: break except OSError: - if socket_ttl: # this is an acceptable error while doing traceroute + if socket_ttl: # this is an acceptable error while doing traceroute break except Exception as e: print(e) @@ -184,6 +191,13 @@ shutdown = True # pressed once, exit gracefully +def unsupported_feature(): + print("Error: You have an older version of Python interpreter.") + print(" Some features such as DoT and DoH are not available. You should upgrade") + print(" the Python interpreter to at least 3.6 and reinstall dependencies.") + sys.exit(127) + + def flags_to_text(flags): # Standard DNS flags @@ -209,7 +223,7 @@ } _by_value = dict([(y, x) for x, y in _by_text.items()]) - _flags_order = sorted(_by_value.items(), reverse=True) + # _flags_order = sorted(_by_value.items(), reverse=True) _by_value = dict([(y, x) for x, y in _by_text.items()]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnsdiag-2.0.0/util/whois.py new/dnsdiag-2.0.2/util/whois.py --- old/dnsdiag-2.0.0/util/whois.py 2021-04-03 18:56:18.000000000 +0200 +++ new/dnsdiag-2.0.2/util/whois.py 2021-04-05 15:48:37.000000000 +0200 @@ -50,7 +50,7 @@ c = cymruwhois.Client() asn = c.lookup(ip) whois_cache[ip] = (asn, currenttime) - except Exception as e: + except Exception: pass return asn, whois_cache