Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 85399
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: PHILIPP [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.66
Fixed in: (no value)



Subject: txtdata() potentially useful but breaks spec
I'm looking at the Net::DNS::RR::TXT::txtdata() method: sub txtdata { my $self = shift; return join(' ', $self->char_str_list()); } and believe that the RFC is clear about how to interpret multi-value TXT RHS's: the values are to be concatenated with no spaces between them. So the function, in the abstract, is useful. It just does the wrong thing. Quoting RFC-4408: 3.1.3. Multiple Strings in a Single DNS record As defined in [RFC1035] sections 3.3.14 and 3.3, a single text DNS record (either TXT or SPF RR types) can be composed of more than one string. If a published record contains multiple strings, then the record MUST be treated as if those strings are concatenated together without adding spaces. For example: IN TXT "v=spf1 .... first" "second string..." MUST be treated as equivalent to IN TXT "v=spf1 .... firstsecond string..." SPF or TXT records containing multiple strings are useful in constructing records that would exceed the 255-byte maximum length of a string within a single TXT or SPF RR record.
From: rwfranks [...] acm.org
On Fri May 17 18:07:43 2013, PHILIPP wrote: Show quoted text
> I'm looking at the Net::DNS::RR::TXT::txtdata() method:
[snip] Show quoted text
> and believe that the RFC is clear about how to interpret multi-value > TXT RHS's: the values are to be concatenated with no spaces between > them. So the function, in the abstract, is useful. It just does the > wrong thing.
RFC4408 imposes no requirement on TXT. TXT is a creature of RFC1035. RFC4408 requires SPF implementations, which in this instance is your script, to concatenate strings without intervening spaces. The present implementation (0.72)is context-sensitive, allowing you to do this in one line. $spf = join '', $txt->txtdata; This behaviour is baked into the SPF RR.