mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user