Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: trashcan [...] odo.in-berlin.de
Cc:
AdminCc:

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



Subject: Net::DNS 0.77 cannot deal with trailing comments in /etc/resolv.conf
Date: Sun, 29 Jun 2014 15:24:01 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: Michael Grimm <trashcan [...] odo.in-berlin.de>
Hi -- After upgrading from Net::DNS 0.76 to Net::DNS 0.77 spamassassin failed to daemonize. After some investigations I found the reason in Net::DNS 0.77 lack of stripping trailing comments in /etc/resolv.conf: Will be parsed correctly in <= 0.76 but will not work with spamassassin and Net::DNS 0.77: /etc/resolv.conf nameserver 8.8.8.8 # Google Removing those trailing comments will work with spamassassin and Net::DNS 0.77: /etc/resolv.conf nameserver 8.8.8.8 The following patch will re-introduce that part of the code responsible for dealing with comments in versions <= 0.76: ------------------------------------- SNIP ----------------------------- --- /usr/local/lib/perl5/site_perl/5.16/mach/Net/DNS/Resolver/Base.pm 2014-06-13 23:02:31.000000000 +0200 +++ Base.pm--0.76-way-to-strip-comments-in-resolv.conf 2014-06-28 18:31:06.492446355 +0200 @@ -234,6 +234,10 @@ local $_; while (<FILE>) { + s/\s*[;#].*$//; # strip comment + next unless m/\S/; # skip empty line + s/^\s+//; # strip leading space + /^nameserver/ && do { my ( $keyword, @ip ) = split; push @ns, map { $_ eq '0' ? '0.0.0.0' : $_ } @ip; ------------------------------------- SNIP ----------------------------- Here are the details of OS, Perl and Net::DNS port installed: Show quoted text
test> uname -v
FreeBSD 10.0-STABLE #0 r267840: Tue Jun 24 23:08:16 CEST 2014 root@kaan-bock.net:/usr/obj/usr/src/sys/CUSTOM Show quoted text
test> perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for amd64-freebsd-thread-multi Show quoted text
test> pkg info | grep DNS
p5-Net-DNS-0.77 Perl5 interface to the DNS resolver, and dynamic updates Regards, Michael
From: rwfranks [...] acm.org
Net::DNS is expected to eat Unix/linux /etc/resolv.conf. The relevant man page is very specific: The keyword and value must appear on a single line, and the keyword (e.g., nameserver) must start the line. The value follows the keyword, separated by white space. Lines that contain a semicolon (;) or hash character (#) in the first column are treated as comments. It says absolutely nothing about trailing comments.
Subject: Re: [rt.cpan.org #96814] Net::DNS 0.77 cannot deal with trailing comments in /etc/resolv.conf
Date: Mon, 30 Jun 2014 20:40:33 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: Michael Grimm <trashcan [...] odo.in-berlin.de>
On 30.06.2014, at 02:39, Dick Franks via RT <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=96814 > > > Net::DNS is expected to eat Unix/linux /etc/resolv.conf. > > The relevant man page is very specific:
This line is found in both man pages on a Linux OS and on a Unix OS (FreeBSD): Show quoted text
> The keyword and value must appear on a single line, and the keyword (e.g., nameserver) must start the > line. The value follows the keyword, separated by white space.
This line is found in the man page on a Linux OS, only: Show quoted text
> Lines that contain a semicolon (;) or hash character (#) in the first column are treated as comments.
(http://www.freebsd.org/cgi/man.cgi?query=resolv.conf&sektion=5) Show quoted text
> It says absolutely nothing about trailing comments.
The relevant man page in FreeBSD says nothing about any comments at all. All DNS tools fetching DNS information I am aware of are able to deal with trailing comments in /etc/resolv.conf. Net::DNS before 0.77 has been able to deal with those comments as well. If you do intend to stick with the removal of the relevant code, then please, add that information to your Changes file. Thanks and regards, Michael
Thank you Michael, removal of trailing comments is reintroduced in 0.78.
Subject: Re: [rt.cpan.org #96814] Net::DNS 0.77 cannot deal with trailing comments in /etc/resolv.conf
Date: Thu, 10 Jul 2014 18:31:46 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: Michael Grimm <trashcan [...] odo.in-berlin.de>
On 10.07.2014, at 16:26, NLnet Labs via RT <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=96814 > > > Thank you Michael, removal of trailing comments is reintroduced in 0.78.
Thank you for that quick fix, it's highly appreciated, and with kind regards, Michael