Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 97249
Status: resolved
Priority: 0/
Queue: Net-ISC-DHCPd

People
Owner: Nobody in particular
Requestors: thomas.brunko [...] id1.de
Cc:
AdminCc:

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



Subject: Net::ISC::DHCPd::Config::parse fails to parse the 'authoritative' statement.
Date: Tue, 15 Jul 2014 14:18:11 +0200
To: bug-Net-ISC-DHCPd [...] rt.cpan.org
From: Thomas Brunko <thomas.brunko [...] id1.de>

I'm trying to parse a dhcpd.conf file using the parse method of Net::ISC::DHCPd::Config. As soon as the parse method reaches the 'authoritative' statement, it starts spewing error messages and refuses to parse the rest of the configuration.

To reproduce the errror:

  1. Create a file 'dhcpd.conf' with the following content:
       server-identifier dhcp.example.com;
       option netbios-name-servers 192.168.2.1;
       option netbios-node-type 8;
       authoritative;
       default-lease-time 36000;
       max-lease-time 72000;
       allow booting;
    While this is not a useful dhcp configuration, it suffices to demonstrate the problem.
  2. In the same directory, create a small perl script 'test.pl':
       use strict;
       use warnings;
       use Net::ISC::DHCPd::Config;
       my $config = Net::ISC::DHCPd::Config->new( file => 'dhcpd.conf' );
       $config->parse();
       print $config->generate();
  3. Run the script with 'perl test.pl'.

The resulting output is:

Could not parse "authoritative;" at dhcpd.conf line 4
Could not parse "authoritative; default-lease-time 36000;" at dhcpd.conf line 5
Could not parse "authoritative; default-lease-time 36000; max-lease-time 72000;" at dhcpd.conf line 6
Could not parse "authoritative; default-lease-time 36000; max-lease-time 72000; allow booting;" at dhcpd.conf line 7
server-identifier dhcp.example.com;
option netbios-name-servers 192.168.2.1;
option netbios-node-type 8;

The last three lines of the output are the result of the 'generate' method. These lines demonstrate, that the parser ignores the lines after the 'authoritative' statement. The parser works fine if we replace the 'authoritative' statement with its negation 'not authoritative' or if we remove the statement.

I'm using perl 5.18.2 and Net::ISC::DHCPd 0.17.

Regards,
Thomas Brunko

--
Thomas Brunko
E-Mail thomas.brunko@id1.de, phone +49-69-244502-37, fax +49-69-244502-10
Home www.id1.de

Information Design One AG, Baseler Strasse 10, 60329 Frankfurt am Main, Germany
Registration: Amtsgericht Frankfurt am Main, HRB 52596
Executive Board: Robert Peters, Supervisory Board: Roman Gerike (Chairman), Beate Baumm-Rguig, Lynn Reiländer


  



I think this was resolved via github