Bug 267966 - ISC DHCP SERVER reads configuration from LDAP in chronological instead of logical order
Summary: ISC DHCP SERVER reads configuration from LDAP in chronological instead of log...
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 10.2
Classification: openSUSE
Component: Network (show other bugs)
Version: Final
Hardware: All openSUSE 10.2
: P5 - None : Major (vote)
Target Milestone: ---
Assignee: Marius Tomaschewski
QA Contact: E-mail List
URL: http://www.fsproductions.de
Whiteboard:
Keywords: dogfood
Depends on:
Blocks:
 
Reported: 2007-04-25 14:42 UTC by Stefan Schäfer
Modified: 2007-06-14 09:17 UTC (History)
2 users (show)

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Schäfer 2007-04-25 14:42:29 UTC
At start time of the isc dhcp server with ldap support, it builds a temporary  text based configuration file. If in this file a host declaration follows after the subnet declaration the dhcp server crashes with the following error message:

"Starting DHCP server - please wait for Server info! (60 s)Internet Systems Consortium
DHCP Server V3.0.5
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
LDAP line 18: semicolon expected.
^
LDAP:      cannot      parse    dhcpService      entry 'cn=DHCP Config,ou=DHCP-
Server,dc=iset,dc=hanau'
Configuration file errors encountered – exiting“

This ever happens if i put a new host declaration into the ldap-dit.
It did not happen if i first remove the subnet declaration, enter then the host declaration and rebuild finally the subnet declaration.

I tested this on several machines with ldbm and bdb as ldap database backends.

With SuSE Linux 10.0 everything works fine.

Example LDIF files

wurzel.ldif:

dn: dc=iset,dc=hanau
objectClass: dcObject
objectClass: organization
dc: iset
o: ISET e.V.
description: INFO-Server - LDAP
structuralObjectClass: organization

dn: uid=Admin,dc=iset,dc=hanau
objectClass: top
objectClass: account
objectClass: simpleSecurityObject
uid: Admin
userPassword:: e1NTSEF9Uktkd1B3UEtubXc4WFlDaE1SZ2dYdVkrOElIR2VxU2k=
description: Verzeichnis Administrator
structuralObjectClass: account

dn: ou=DHCP-Server,dc=iset,dc=hanau
objectClass: organizationalUnit
objectClass: top
ou: DHCP-Server
description: Basisknoten fuer den DHCP Server
structuralObjectClass: organizationalUnit

dhcp-options.ldif:

#DHCP Server
dn: cn=hanau-1dom0,ou=DHCP-Server,dc=iset,dc=hanau
cn: hanau-1dom0
objectClass: top
objectClass: dhcpServer
dhcpServiceDN: cn=DHCP Config,ou=DHCP-Server,dc=iset,dc=hanau

#DHCP-Konfigurationsknoten & globale DHCP Optionen
dn: cn=DHCP Config,ou=DHCP-Server,dc=iset,dc=hanau
cn: DHCP Config
objectClass: top
objectClass: dhcpService
objectClass: dhcpOptions
dhcpPrimaryDN: cn=hanau-1dom0,ou=DHCP-Server,dc=iset,dc=hanau
dhcpStatements: ddns-update-style interim
dhcpStatements: ignore client-updates
dhcpStatements: include "/etc/named.keys"
dhcpStatements: default-lease-time 36000
dhcpStatements: max-lease-time 864000
dhcpOption: domain-name "iset.hanau"
dhcpOption: domain-name-servers 172.16.11.10
dhcpOption: broadcast-address 172.16.154.255
dhcpOption: netbios-name-servers 172.17.154.20
dhcpOption: netbios-node-type 8
dhcpOption: routers 172.16.154.253
dhcpOption: subnet-mask 255.255.255.0

dhcp-test.ldif:

#Host Konfigurationen
dn: cn=hanau-roland, cn=DHCP Config, ou=DHCP-Server,dc=iset,dc=hanau
cn: hanau-roland
objectClass: top
objectClass: dhcpHost
dhcpHWAddress: ethernet 00:60:97:af:31:25
dhcpStatements: fixed-address 172.16.154.100

# Dynamischer Bereich
dn: cn=172.16.154.0, cn=DHCP Config, ou=DHCP-Server,dc=iset,dc=hanau
cn: 172.16.154.0
objectClass: top
objectClass: dhcpSubnet
dhcpNetMask: 24
dhcpRange: 172.16.154.190 172.16.154.199
dhcpStatements: zone iset.hanau. { primary 172.16.11.10; key DHCP_UPDATER; }
dhcpStatements: zone 154.16.172.in-addr.arpa. { primary 172.16.11.10; key DHCP_U
PDATER; }

If you put this three ldif files in your ldap everything works fine. If you put another host declaration into the last file after the subnet declaration the dhcp server crashes as described.

dhcpd.conf:

# DHCP Server Konfiguration fuer
# FSP INVIS4 Backoffice Server
# mit LDAP Anbindung

ldap-server "localhost";
ldap-port 389;
ldap-username "cn=Manager,dc=iset,dc=hanau";
ldap-password "secret";
ldap-base-dn "ou=DHCP-Server,dc=iset,dc=hanau";
ldap-method dynamic;
ldap-debug-file "/var/log/dhcp-ldap-startup.log";

# Erstellt am 03.02.07


 Regards Stefan
Comment 1 Marius Tomaschewski 2007-04-26 14:51:33 UTC
Stefan,
can you try out please, if the problems still occurs with RPMs from:

  http://www.suse.de/~mt/dhcp/
Comment 2 Stefan Schäfer 2007-04-27 10:04:53 UTC
I 've tested the new packages on 32bit and 64bit Installations and everything works without problems.

Stefan
Comment 3 Marius Tomaschewski 2007-05-14 13:57:45 UTC
Thanks for retesting Stefan!

The above RPMs contain also (ported) fixes for another important further
bugs, that we found during our SLES10 SP1 developement & tests:

Fri Apr 27 11:07:53 CEST 2007 - mt@suse.de
- Bug #267966: Fixed ldap_read_function to avoid returning of 
  an empty strings causing parsing errors in ldap-dynamic mode.
  New patch file: dhcp-3.0.5-ldap-patch-ldap_read.dif
- Bug #265337: Fix to generate proper "host ... {" block begin
  brace even if no harware address is specified for the host.
  New patch file: dhcp-3.0.5-ldap-patch_host_brace.dif
- Bug #250153: Fix for object order related parse error, that
  occured in case an dhcp-ldap object referencing a dhcp-class
  object was parsed before the declaration of the class. 
  New patch file: dhcp-3.0.5-ldap-patch_object-order.dif
- Bug #162186: Added check for EOF in parse_pool_statement to
  avoid endless recursion loop between parse_pool_statement
  and parse_statement when a closing right brace "}" is missed
  at the end of a pool declaration in /etc/dhcpd.conf.
  New patch file: dhcp-3.0.5-pool_eof.dif
Comment 7 Anja Stock 2007-05-16 15:21:54 UTC
Marius, SWAMPID is 9985
Comment 8 Marius Tomaschewski 2007-06-01 09:54:42 UTC
OK, fixed, patchinfo submitted and goes its way.
Comment 9 Anja Stock 2007-06-14 09:17:24 UTC
released together with 265337 250153 162186 for 10.2