From e41282fbc693e24535956c8822786e9e0bc3e8b4 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Fri, 3 Feb 2012 10:01:27 +0100 Subject: Fix TXT record parsing TXT record validation fails to parse the record if it contains spaces. Standard DNS part parser uses a space to divide record parts. A special parser thus need to be implemented for this RR type. https://fedorahosted.org/freeipa/ticket/2306 --- ipalib/plugins/dns.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ipalib/plugins/dns.py') diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index da4934fc..d51c2c30 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -1003,6 +1003,10 @@ class TXTRecord(DNSRecord): ), ) + def _get_part_values(self, value): + # ignore any space in TXT record + return (value,) + _dns_records = ( ARecord(), AAAARecord(), @@ -1536,6 +1540,8 @@ class dnsrecord(LDAPObject): u'dnsdata' : dnsvalue } values = param._get_part_values(dnsvalue) + if values is None: + continue for val_id, val in enumerate(values): if val is not None: dnsentry[parts_params[val_id].name] = val -- cgit