RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1151942 - virsh net-edit should check commas in DNS TXT record name.
Summary: virsh net-edit should check commas in DNS TXT record name.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-13 07:06 UTC by lcheng
Modified: 2015-11-19 05:53 UTC (History)
4 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:53:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description lcheng 2014-10-13 07:06:57 UTC
Description of problem:
virsh net-edit should check commas in DNS TXT record name.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
[root@localhost ~]# firefox file:///usr/share/doc/libvirt-docs-1.2.8/html/formatnetwork.html#elementsAddress
...
dns
    txt
        ...names cannot contain embedded spaces or commas.


[root@localhost dnsmasq]# virsh net-edit default
error: prohibited space character in DNS TXT record name 'example redhat' of network default
Failed. Try again? [y,n,f,?]:
Network default XML configuration edited.

[root@localhost dnsmasq]# virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>31662273-8ae2-4443-85f0-6f46000e95fa</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:93a:52'/>
  <dns>
    <forwarder addr='8.8.4.4'/>
    <txt name='example,redhat' value='test'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

Actual results:
As description.

Expect result:
virsh net-edit should also check commas in DNS TXT record name.

Comment 2 Michal Privoznik 2015-02-23 12:41:06 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2015-February/msg00875.html

Comment 3 Michal Privoznik 2015-02-24 14:04:47 UTC
And moving to POST:

commit 39df9d2f12829a8f1e50d78d5952ba367d6c3343
Author:     Michal Privoznik <mprivozn>
AuthorDate: Mon Feb 23 13:19:16 2015 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Tue Feb 24 10:07:47 2015 +0100

    network_conf: Forbid commas in DNS TXT
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1151942
    
    While the restriction doesn't have origin in any RFC, it matters
    to us while constructing the dnsmasq config file (or command line
    previously). For better picture, this is how the corresponding
    part of network XML look like:
    
      <dns>
        <forwarder addr='8.8.4.4'/>
        <txt name='example' value='example value'/>
      </dns>
    
    And this is how the config file looks like then:
    
      server=8.8.4.4
      txt-record=example,example value
    
    Now we can see why there can't be any commas in the TXT name.
    They are used by dnsmasq to separate @name and @value.
    
    Funny, we have it in the documentation, but the code (which was
    pushed back in 2011) didn't reflect that.
    
    Signed-off-by: Michal Privoznik <mprivozn>

v1.2.13-rc1-1-g39df9d2

Comment 5 hongming 2015-04-10 09:39:59 UTC
Verify it as follows.The result is expected. Move its status to VERIFIED. 

# rpm -q libvirt
libvirt-1.2.14-1.el7.x86_64

# virsh net-edit default

<network ipv6='yes'>
  <name>default</name>
  <uuid>771dc61a-0632-4ab3-b2cb-d1dc8fe5029c</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' macTableManager='libvirt'/>
  <mac address='52:54:00:7b:90:55'/>
  <dns>
    <forwarder addr='8.8.4.4'/>
    <txt name='example,redhat' value='redhat,test'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>
~                      

error: prohibited character in DNS TXT record name 'example,redhat' of network default
Failed. Try again? [y,n,f,?]: 


# virsh net-edit default

<network ipv6='yes'>
  <name>default</name>
  <uuid>771dc61a-0632-4ab3-b2cb-d1dc8fe5029c</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' macTableManager='libvirt'/>
  <mac address='52:54:00:7b:90:55'/>
  <dns>
    <forwarder addr='8.8.4.4'/>
    <txt name='example ' value='redhat,test'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

error: prohibited character in DNS TXT record name 'example ' of network default
Failed. Try again? [y,n,f,?]:

Comment 7 errata-xmlrpc 2015-11-19 05:53:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


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