Bug 1731100 - Label escaping bug for special characters breaks ipa dnszone-show
Summary: Label escaping bug for special characters breaks ipa dnszone-show
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dns
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Wouters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-18 09:55 UTC by Christian Heimes
Modified: 2020-02-12 02:14 UTC (History)
4 users (show)

Fixed In Version: python-dns-1.16.0-1.fc30 python-dns-1.16.0-7.fc30 python-dns-1.16.0-7.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-12 01:40:55 UTC
Type: ---
Embargoed:
aviso: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure freeipa issue 7739 0 None None None 2019-07-18 09:55:09 UTC
Github rthalley dnspython issues 339 0 'None' closed Name.to_unicode does not escape special chars 2020-08-13 07:27:13 UTC

Description Christian Heimes 2019-07-18 09:55:10 UTC
This bug was initially created as a copy of Bug #1731081

I am copying this bug because: 
The bug also affects FreeIPA on Fedora.


Description of problem:
dns.name.Name 's to_unicode() method has a bug. It escapes special characters to wrong way. In DNS the email address admin.1 is encoded as admin\.1.example.com. The to_unicode() method drops the quoting and turns the email address into admin.com (encoded admin.1.example.com).

The issue causes problems with IdM and breaks ipa dnszone-show command.

Version-Release number of selected component (if applicable):
python3-dns-1.15.0

How reproducible:
always

Steps to Reproduce:
$ python3
>>> import dns.name
>>> name = dns.name.from_text("admin\\.1.example.com")
>>> name
<DNS name admin\.1.example.com.>
>>> name.to_text()
'admin\\.1.example.com.'
>>> name.to_unicode()
'admin.1.example.com.'


Actual results:
name.to_unicode() returns 'admin.1.example.com.'

Expected results:
'admin\\.1.example.com.'

Additional info:
Upstream fix https://github.com/rthalley/dnspython/commit/c76aa6ac9969447220c8e807aa1e5640a6c12924

Comment 1 Avram Lubkin 2019-07-18 10:06:32 UTC
Can you ask upstream for a new release? They haven't had one in 7 months and I wouldn't want to patch this and then turn around and pull the patch out when they do an update.

Comment 2 Christian Heimes 2019-07-18 10:18:54 UTC
We asked upstream for a new release a while ago. AFAIK the bug is not critical enough to make a release. IIRC they release about once a year, too.

Also the 1.x series is dead. 1.16 was the last version. Upstream is currently working on dnspython 2.0. The new version is probably slightly incompatible with 1.x. They haven't scheduled a relase date, yet.

From http://www.dnspython.org/
> The stable version of dnspython is 1.16.0, released on December 8, 2018.
> Python 2.x support ends with the release of 1.16.0, unless there are critical bugs in 1.16.0. Future versions of dnspython will only support Python 3.
> Version numbering of future dnspython releases will also start at 2.0, as incompatible changes will be permitted. We're not planning huge changes at this time, but we'd like to do a better job at IDNA, and there are other API improvements to be made.

Comment 3 Avram Lubkin 2019-07-28 03:52:26 UTC
I started working on this. The problem is the commit breaks 2.7 and, even though I'd like to, we can't drop python2 because other packages still depend on it. When I get a chance I'll see if I can make a patch that will fix the bug but not break 2.7

Comment 4 Fedora Update System 2019-07-28 13:36:41 UTC
FEDORA-2019-2a9356957c has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2a9356957c

Comment 5 Fedora Update System 2019-07-29 04:41:50 UTC
python-dns-1.16.0-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2a9356957c

Comment 6 Fedora Update System 2019-08-06 01:18:44 UTC
python-dns-1.16.0-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Christian Heimes 2019-11-15 15:15:08 UTC
python-dns-1.16.0-1.fc30 is still broken for us. The patch is in the dist git of python-dns but commented out in the spec file:

https://src.fedoraproject.org/rpms/python-dns/blob/master/f/python-dns.spec#_37

Comment 8 Christian Heimes 2020-01-13 14:30:11 UTC
Avram, could you please fix the spec file so that your patch is applied on build?

Comment 9 Avram Lubkin 2020-01-22 15:35:29 UTC
Had to redo the patch. Changes should be in rawhide soon, 1.16.0-6
https://bodhi.fedoraproject.org/updates/FEDORA-2020-8777a3c3bc

Please test and confirm it works for you.

Comment 10 Fedora Update System 2020-02-03 12:59:00 UTC
FEDORA-2020-51854dddd8 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-51854dddd8

Comment 11 Fedora Update System 2020-02-03 13:04:06 UTC
FEDORA-2020-6c9cbe2c1e has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-6c9cbe2c1e

Comment 12 Fedora Update System 2020-02-04 00:59:25 UTC
python-dns-1.16.0-7.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-51854dddd8

Comment 13 Fedora Update System 2020-02-04 01:47:33 UTC
python-dns-1.16.0-7.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-6c9cbe2c1e

Comment 14 Christian Heimes 2020-02-11 14:58:48 UTC
Thanks, python-dns-1.16.0-7.fc31 fixes the quoting issue that we saw in FreeIPA.

# ipa dnszone-mod --admin-email admin.1. ipa.example.
  Zone name: ipa.example.
  Active zone: TRUE
  Authoritative nameserver: master.ipa.example.
  Administrator e-mail address: admin\.1.ipa.example.

Comment 15 Fedora Update System 2020-02-12 01:40:55 UTC
python-dns-1.16.0-7.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2020-02-12 02:14:57 UTC
python-dns-1.16.0-7.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.