From Joerg.Pulz@frm2.tum.de  Fri Aug 27 13:39:01 2004
Return-Path: <Joerg.Pulz@frm2.tum.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 556BF16A55E
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Aug 2004 13:39:01 +0000 (GMT)
Received: from mailhost.frm2.tum.de (mailhost.frm2.tum.de [129.187.179.12])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D5F5A43D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Aug 2004 13:38:59 +0000 (GMT)
	(envelope-from Joerg.Pulz@frm2.tum.de)
Received: from localhost (mailhost.frm2.tum.de [129.187.179.12])
	by mailhost.frm2.tum.de (8.12.10/8.12.10) with ESMTP id i7RDcuH4064414;
	Fri, 27 Aug 2004 15:38:56 +0200 (CEST)
	(envelope-from jpulz@frm2.tum.de)
Received: from hades.admin.frm2 (hades.admin.frm2 [172.25.1.10])
	by mailhost.frm2.tum.de (8.12.10/8.12.10) with ESMTP id i7RDcp9w064410
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 27 Aug 2004 15:38:51 +0200 (CEST)
	(envelope-from jpulz@frm2.tum.de)
Received: from hades.admin.frm2 (localhost [127.0.0.1])
	by hades.admin.frm2 (8.12.10/8.12.10) with ESMTP id i7RDcpW3035849;
	Fri, 27 Aug 2004 15:38:51 +0200 (CEST)
	(envelope-from jpulz@frm2.tum.de)
Received: (from jpulz@localhost)
	by hades.admin.frm2 (8.12.10/8.12.10/Submit) id i7RDcpFA035848;
	Fri, 27 Aug 2004 15:38:51 +0200 (CEST)
	(envelope-from jpulz)
Message-Id: <200408271338.i7RDcpFA035848@hades.admin.frm2>
Date: Fri, 27 Aug 2004 15:38:51 +0200 (CEST)
From: Joerg Pulz <Joerg.Pulz@frm2.tum.de>
Reply-To: Joerg Pulz <Joerg.Pulz@frm2.tum.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: cyrille.lefevre@laposte.net
Subject: add LDAP backend support to net/isc-dhcp3-server
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71030
>Category:       ports
>Synopsis:       add LDAP backend support to net/isc-dhcp3-server
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 27 13:40:27 GMT 2004
>Closed-Date:    Wed Oct 13 00:15:11 GMT 2004
>Last-Modified:  Wed Oct 13 00:15:11 GMT 2004
>Originator:     Joerg Pulz
>Release:        FreeBSD 5.2.1-RELEASE-p8 i386
>Organization:
TU-Munich / ZWE FRM-II
>Environment:
System: FreeBSD hades.admin.frm2 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #4: Tue Aug 17 11:51:25 CEST 2004 root@hades.admin.frm2:/usr/obj/usr/src/sys/HADES i386


	
>Description:
	with some modifications to the port itself and utilizing a patch
	from Brian Masney (http://www.newwave.net/~masneyb/) it is
	possible to use an LDAP backend to store the configuration
	for dhcpd, the different network and host entries. dynamic leases
	are also written to the LDAP backend.
	this is very useful in a dhcp failover environment, as it is no
	longer necessary to sync the dhcpd.conf file manually to the
	backup system if one has changed something on the dhcp master.
	two lookup methods are implemented.
	- static lookup:
		on dhcpd startup one LDAP lookup for all entries is done.
		no further lookups will be made.
		dhcpd must be restarted for every configuration change.
	- dynamic lookup:
		for every client request an LDAP lookup will be made.
		every configuration change kicks in when the next
		client request is recieved and the lookup is made.
>How-To-Repeat:
	
>Fix:

	

--- isc-dhcp3-server.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/Makefile,v
retrieving revision 1.101
diff -u -r1.101 Makefile
--- Makefile	20 Aug 2004 11:52:33 -0000	1.101
+++ Makefile	27 Aug 2004 13:11:26 -0000
@@ -30,7 +30,9 @@
 .endif
 .if ${SUBSYS} == server
 OPTIONS=	DHCP_PARANOIA "add -user, -group and -chroot options" on \
-		DHCP_JAIL "add -chroot and -jail options" on
+		DHCP_JAIL "add -chroot and -jail options" on \
+		DHCP_LDAP "add experimental LDAP backend support" off \
+		DHCP_LDAP_SSL "support LDAP connection over SSL/TLS" on
 .endif
 
 .include <bsd.port.pre.mk>
@@ -118,6 +120,11 @@
 .endif
 .if !defined(NOPORTDOCS)
 PORTDOCS=	LICENSE README RELNOTES
+.if ${SUBSYS} == server
+.ifdef(WITH_DHCP_LDAP)
+PORTDOCS+=	README.ldap
+.endif
+.endif
 .endif
 
 SAMP_SUFX=	.sample
@@ -139,7 +146,32 @@
 .else
 RCSCRIPTS_SUB+=	JAIL=NO
 .endif
-PKGMESSAGE_SUB=	PREFIX=${PREFIX} MAN1PREFIX=${MAN1PREFIX}
+PKGMESSAGE_SUB=	PREFIX=${PREFIX} MAN1PREFIX=${MAN1PREFIX} \
+		DOCSDIR=${DOCSDIR} SCHEMA_DIR=${SCHEMA_DIR}
+
+.if ${SUBSYS} == server
+.ifdef(WITH_DHCP_LDAP)
+# Based on patch from Brian Masney.
+# http://www.newwave.net/~masneyb/
+PATCH_SITES=	http://www.newwave.net/~masneyb/
+PATCHFILES=	${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}-ldap-patch
+PATCH_DIST_STRIP=	-p1
+USE_PERL5_RUN=	yes
+USE_OPENLDAP=	yes
+LDAP_SCRIPT=	contrib/dhcpd-conf-to-ldap.pl
+LDAP_SCHEMA=	contrib/dhcp.schema
+SCHEMA_DIR=	${PREFIX}/share/${PKGBASE}
+PLIST_SUB+=	LDAP="" \
+		PKGBASE=${PKGBASE}
+.if defined(WITH_DHCP_LDAP_SSL)
+USE_OPENSSL=	yes
+# hack to get bsd.openssl.mk included at this late state
+.include "${PORTSDIR}/Mk/bsd.openssl.mk"
+.endif
+.else
+PLIST_SUB+=	LDAP="@comment "
+.endif
+.endif
 
 # Post-extract
 #
@@ -179,6 +211,15 @@
 .if !defined(WITHOUT_DHCP_JAIL)
 	@${ECHO_CMD} CFLAGS += -DJAIL >> ${WRKSRC}/site.conf
 .endif
+.ifdef(WITH_DHCP_LDAP)
+	@${ECHO_CMD} CFLAGS += -I${LOCALBASE}/include >> ${WRKSRC}/site.conf
+	@${ECHO_CMD} LIBS += -L${LOCALBASE}/lib >> ${WRKSRC}/site.conf
+.ifdef(WITH_DHCP_LDAP_SSL)
+	@${ECHO_CMD} CFLAGS += -DUSE_SSL -I${OPENSSLINC} >> ${WRKSRC}/site.conf
+	@${ECHO_CMD} LIBS += -L${OPENSSLLIB} >> ${WRKSRC}/site.conf
+	@${ECHO_CMD} LIBS += -lcrypto -lssl >> ${WRKSRC}/site.conf
+.endif
+.endif
 .endif
 
 patch-makefile-conf:
@@ -205,6 +246,11 @@
 .if ${SUBSYS} != devel
 	@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
 		${MSG_FILE} > ${PKGMESSAGE}
+.ifndef(WITH_DHCP_LDAP)
+	@${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE}
+.else
+	@${REINPLACE_CMD} -e 's|^%%LDAP%%||g' ${PKGMESSAGE}
+.endif
 .endif
 
 # Post-install
@@ -216,7 +262,7 @@
 
 parallel-post-install: \
 	strip-binary-files install-startup-files \
-	install-doc-files install-sample-files \
+	install-doc-files install-ldap-files install-sample-files \
 	create-conf-files create-data-files
 
 strip-binary-files:
@@ -242,6 +288,15 @@
 .endfor
 .endif
 
+install-ldap-files:
+.if ${SUBSYS} == server
+.ifdef(WITH_DHCP_LDAP)
+	@${INSTALL_SCRIPT} ${WRKSRC}/${LDAP_SCRIPT} ${PREFIX}/bin
+	@${MKDIR} ${SCHEMA_DIR}
+	@${INSTALL_DATA} ${WRKSRC}/${LDAP_SCHEMA} ${SCHEMA_DIR}
+.endif
+.endif
+
 install-sample-files:
 .for f in ${SAMP_FILES}
 	@${INSTALL_DATA} ${WRKSRC}/${f} ${CONF_DIR}/${f:T}${SAMP_SUFX}
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/distinfo,v
retrieving revision 1.47
diff -u -r1.47 distinfo
--- distinfo	25 Jun 2004 18:50:13 -0000	1.47
+++ distinfo	27 Aug 2004 13:11:26 -0000
@@ -1,2 +1,4 @@
 MD5 (dhcp-3.0.1rc14.tar.gz) = a68074d9ebdeb355c293d9b3645b3c2c
 SIZE (dhcp-3.0.1rc14.tar.gz) = 842712
+MD5 (dhcp-3.0.1rc14-ldap-patch) = 38fde70e0f27758da2be70ce46c17f8b
+SIZE (dhcp-3.0.1rc14-ldap-patch) = 152494
Index: pkg-message
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-message,v
retrieving revision 1.7
diff -u -r1.7 pkg-message
--- pkg-message	18 Aug 2004 09:31:58 -0000	1.7
+++ pkg-message	27 Aug 2004 13:11:26 -0000
@@ -39,3 +39,9 @@
       variables are still read there but should be moved /etc/rc.conf or
       /etc/rc.conf.d/dhcpd instead.  Also, the dhcpd_options variable must
       be renamed dhcpd_flags if any.
+%%LDAP%%
+%%LDAP%%****  You have requested support for the LDAP configuration backend.
+%%LDAP%%      The OpenLDAP schema file is installed as
+%%LDAP%%      %%SCHEMA_DIR%%/dhcp.schema.
+%%LDAP%%      See %%DOCSDIR%%/README.ldap for further
+%%LDAP%%      LDAP configuration details.
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-plist,v
retrieving revision 1.29
diff -u -r1.29 pkg-plist
--- pkg-plist	26 Jun 2004 14:32:40 -0000	1.29
+++ pkg-plist	27 Aug 2004 13:11:26 -0000
@@ -1,5 +1,8 @@
 @comment $FreeBSD: ports/net/isc-dhcp3-server/pkg-plist,v 1.29 2004/06/26 14:32:40 eik Exp $
 bin/omshell
+%%LDAP%%bin/dhcpd-conf-to-ldap.pl
 etc/dhcpd.conf.sample
 etc/rc.d/isc-dhcpd.sh
 sbin/dhcpd
+%%LDAP%%share/%%PKGBASE%%/dhcp.schema
+%%LDAP%%@dirrm share/%%PKGBASE%%
--- isc-dhcp3-server.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sat Aug 28 04:18:06 GMT 2004 
State-Changed-Why:  
To maintainer: do you approve of this patch? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71030 

Adding to audit trail from misfiled PR 71187:

Date: Tue, 31 Aug 2004 12:45:10 +0200 (CEST)
From: Cyrille Lefevre <cyrille.lefevre@laposte.net>

 Makefile: ldap support added
 distinfo: ldap patch added
 pkg-message: ldap support added
 pkg-plist: ldap support added
 files/isc-dhcpd.sh.sample: dhcpd_chuser_enable fixed.
 
 Index: Makefile
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/Makefile,v
 retrieving revision 1.100
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.100 Makefile
 --- Makefile	7 Jul 2004 06:47:36 -0000	1.100
 +++ Makefile	31 Aug 2004 10:39:48 -0000
 @@ -8,7 +8,7 @@
  
  PORTNAME=	dhcp
  PORTVERSION=	3.0.1.r14
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	net
  MASTER_SITES=	${MASTER_SITE_ISC}
  MASTER_SITE_SUBDIR=	dhcp dhcp/dhcp-3.0-history
 @@ -30,11 +30,31 @@
  .endif
  .if ${SUBSYS} == server
  OPTIONS=	DHCP_PARANOIA "add -user, -group and -chroot options" on \
 -		DHCP_JAIL "add -chroot and -jail options" on
 +		DHCP_JAIL "add -chroot and -jail options" on \
 +		DHCP_LDAP "add experimental LDAP backend support" off \
 +		DHCP_LDAP_SSL "support LDAP connection over SSL/TLS" on \
 +		OPENSSL_BASE "use the base system OpenSSL (required by TLS)" on \
 +		OPENSSL_PORT "use OpenSSL from ports (requires by TLS)" off
  .endif
  
  .include <bsd.port.pre.mk>
  
 +.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
 +# Based on patch from Brian Masney :
 +PATCH_SITES=	http://www.newwave.net/~masneyb/
 +PATCHFILES=	${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}-ldap-patch
 +PATCH_DIST_STRIP=	-p1
 +
 +USE_PERL5_RUN=	yes
 +USE_OPENLDAP=	yes
 +
 +.if !defined(WITHOUT_DHCP_LDAP_SSL)
 +USE_OPENSSL=	yes
 +# hack to get bsd.openssl.mk included at this late state
 +.include "${PORTSDIR}/Mk/bsd.openssl.mk"
 +.endif
 +.endif
 +
  # Global variables
  #
  
 @@ -102,6 +122,9 @@
  PATCH_SUBDIRS+=	omshell
  .endif
  
 +.if !defined(NOPORTDOCS)
 +PORTDOCS=	LICENSE README RELNOTES
 +.endif
  .if ${SUBSYS} == client
  BIN_FILES=	dhclient
  CONF_FILES=	dhclient.conf
 @@ -112,21 +135,30 @@
  RC_FILES=	isc-dhcpd
  SAMP_FILES=	server/dhcpd.conf
  DATA_FILES=	dhcpd.leases
 +.if defined(WITH_DHCP_LDAP)
 +PORTDOCS+=	README.ldap
 +LDAP_SCRIPT=	contrib/dhcpd-conf-to-ldap.pl
 +LDAP_SCHEMA=	contrib/dhcp.schema
 +.endif
  .elif ${SUBSYS} == relay
  BIN_FILES=	dhcrelay
  RC_FILES=	isc-dhcrelay
  .endif
 -.if !defined(NOPORTDOCS)
 -PORTDOCS=	LICENSE README RELNOTES
 -.endif
  
  SAMP_SUFX=	.sample
  
  CONF_DIR=	${PREFIX}/etc
  RC_DIR=		${PREFIX}/etc/rc.d
 +SCHEMA_DIR=	${PREFIX}/share/${PKGBASE}
  DOCSDIR=	${PREFIX}/share/doc/${PKGBASE}
  DATADIR=	/var/db
  
 +PLIST_SUB+=	SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}"
 +.if defined(WITH_DHCP_LDAP)
 +PLIST_SUB+=	LDAP=""
 +.else
 +PLIST_SUB+=	LDAP="@comment "
 +.endif
  REINPLACE_SUB=	PREFIX=${PREFIX}
  RCSCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
  .if !defined(WITHOUT_DHCP_PARANOIA)
 @@ -139,7 +171,8 @@
  .else
  RCSCRIPTS_SUB+=	JAIL=NO
  .endif
 -PKGMESSAGE_SUB=	PREFIX=${PREFIX} MAN1PREFIX=${MAN1PREFIX}
 +PKGMESSAGE_SUB=	PREFIX="${PREFIX}" MAN1PREFIX="${MAN1PREFIX}" \
 +		DOCSDIR="${DOCSDIR}" SCHEMA_DIR="${SCHEMA_DIR}"
  
  # Post-extract
  #
 @@ -179,6 +212,15 @@
  .if !defined(WITHOUT_DHCP_JAIL)
  	@${ECHO_CMD} CFLAGS += -DJAIL >> ${WRKSRC}/site.conf
  .endif
 +.if defined(WITH_DHCP_LDAP)
 +	@${ECHO_CMD} CFLAGS += -I${LOCALBASE}/include >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -L${LOCALBASE}/lib >> ${WRKSRC}/site.conf
 +.if !defined(WITHOUT_DHCP_LDAP_SSL)
 +	@${ECHO_CMD} CFLAGS += -DUSE_SSL -I${OPENSSLINC} >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -L${OPENSSLLIB} >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -lcrypto -lssl >> ${WRKSRC}/site.conf
 +.endif
 +.endif
  .endif
  
  patch-makefile-conf:
 @@ -205,6 +247,11 @@
  .if ${SUBSYS} != devel
  	@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
  		${MSG_FILE} > ${PKGMESSAGE}
 +.if defined(WITH_DHCP_LDAP)
 +	@${REINPLACE_CMD} -e 's|^%%LDAP%%||g' ${PKGMESSAGE}
 +.else
 +	@${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE}
 +.endif
  .endif
  
  # Post-install
 @@ -216,7 +263,7 @@
  
  parallel-post-install: \
  	strip-binary-files install-startup-files \
 -	install-doc-files install-sample-files \
 +	install-doc-files install-ldap-files install-sample-files \
  	create-conf-files create-data-files
  
  strip-binary-files:
 @@ -240,6 +287,13 @@
  .for f in ${PORTDOCS}
  	@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
  .endfor
 +.endif
 +
 +install-ldap-files:
 +.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
 +	@${INSTALL_SCRIPT} ${WRKSRC}/${LDAP_SCRIPT} ${PREFIX}/bin
 +	@${MKDIR} ${SCHEMA_DIR}
 +	@${INSTALL_DATA} ${WRKSRC}/${LDAP_SCHEMA} ${SCHEMA_DIR}
  .endif
  
  install-sample-files:
 Index: distinfo
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/distinfo,v
 retrieving revision 1.47
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.47 distinfo
 --- distinfo	25 Jun 2004 18:50:13 -0000	1.47
 +++ distinfo	31 Aug 2004 10:39:48 -0000
 @@ -1,2 +1,4 @@
  MD5 (dhcp-3.0.1rc14.tar.gz) = a68074d9ebdeb355c293d9b3645b3c2c
  SIZE (dhcp-3.0.1rc14.tar.gz) = 842712
 +MD5 (dhcp-3.0.1rc14-ldap-patch) = 38fde70e0f27758da2be70ce46c17f8b
 +SIZE (dhcp-3.0.1rc14-ldap-patch) = 152494
 Index: pkg-install
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-install,v
 retrieving revision 1.1
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.1 pkg-install
 Index: pkg-message
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-message,v
 retrieving revision 1.6
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.6 pkg-message
 --- pkg-message	26 Jun 2004 14:32:40 -0000	1.6
 +++ pkg-message	31 Aug 2004 10:39:48 -0000
 @@ -39,3 +39,7 @@
        variables are still read there but should be moved /etc/rc.conf or
        /etc/rc.conf.d/dhcpd instead.  Also, the dhcpd_options variable must
        be renamed dhcpd_flags if any.
 +%%LDAP%%
 +%%LDAP%%****  You have requested support for the LDAP configuration backend.
 +%%LDAP%%      The OpenLDAP schema file is installed as %%SCHEMA_DIR%%/dhcp.schema.
 +%%LDAP%%      See %%DOCSDIR%%/README.ldap for further LDAP configuration details.
 Index: pkg-plist
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-plist,v
 retrieving revision 1.29
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.29 pkg-plist
 --- pkg-plist	26 Jun 2004 14:32:40 -0000	1.29
 +++ pkg-plist	31 Aug 2004 10:39:48 -0000
 @@ -1,5 +1,8 @@
  @comment $FreeBSD: ports/net/isc-dhcp3-server/pkg-plist,v 1.29 2004/06/26 14:32:40 eik Exp $
  bin/omshell
 +%%LDAP%%bin/dhcpd-conf-to-ldap.pl
  etc/dhcpd.conf.sample
  etc/rc.d/isc-dhcpd.sh
  sbin/dhcpd
 +%%LDAP%%%%SCHEMA_DIR%%/dhcp.schema
 +%%LDAP%%@dirrm %%SCHEMA_DIR%%
 Index: files/client::scripts::freebsd
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/files/client::scripts::freebsd,v
 retrieving revision 1.2
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.2 client::scripts::freebsd
 Index: files/isc-dhcpd.sh.sample
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/files/isc-dhcpd.sh.sample,v
 retrieving revision 1.8
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.8 isc-dhcpd.sh.sample
 --- files/isc-dhcpd.sh.sample	26 Jul 2004 20:57:03 -0000	1.8
 +++ files/isc-dhcpd.sh.sample	31 Aug 2004 10:39:49 -0000
 @@ -24,7 +24,7 @@
  dhcpd_ifaces=${dhcpd_ifaces:-}				# ethernet interface(s)
  dhcpd_withumask=${dhcpd_withumask:-022}			# file creation mask
  
 -dhcpd_chuser_enable=${dhcpd_chuser_enable:-"YES"}	# runs w/o privileges?
 +dhcpd_chuser_enable=${dhcpd_chuser_enable:-"%%PARANOIA%%"}	# runs w/o privileges?
  dhcpd_withuser=${dhcpd_withuser:-${name}}		# user name to run as
  dhcpd_withgroup=${dhcpd_withgroup:-${name}}		# group name to run as
  
 Index: files/patch-client::dhclient.8
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/files/patch-client::dhclient.8,v
 retrieving revision 1.4
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.4 patch-client::dhclient.8
 
 Cyrille Lefevre
 -- 
 mailto:cyrille.lefevre@laposte.net

From: Cyrille Lefevre <cyrille.lefevre@laposte.net>
To: freebsd gnats <freebsd-gnats-submit@freebsd.org>
Cc:  
Subject: Re: ports/71030: add LDAP backend support to net/isc-dhcp3-server
Date: Tue, 14 Sep 2004 18:05:02 +0200 (CEST)

 the same as above related to the current revision.
 
 Index: Makefile
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/Makefile,v
 retrieving revision 1.101
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.101 Makefile
 --- Makefile	20 Aug 2004 11:52:33 -0000	1.101
 +++ Makefile	14 Sep 2004 15:45:52 -0000
 @@ -8,7 +8,7 @@
  
  PORTNAME=	dhcp
  PORTVERSION=	3.0.1.r14
 -PORTREVISION=	3
 +PORTREVISION=	4
  CATEGORIES=	net
  MASTER_SITES=	${MASTER_SITE_ISC}
  MASTER_SITE_SUBDIR=	dhcp dhcp/dhcp-3.0-history
 @@ -30,11 +30,31 @@
  .endif
  .if ${SUBSYS} == server
  OPTIONS=	DHCP_PARANOIA "add -user, -group and -chroot options" on \
 -		DHCP_JAIL "add -chroot and -jail options" on
 +		DHCP_JAIL "add -chroot and -jail options" on \
 +		DHCP_LDAP "add experimental LDAP backend support" off \
 +		DHCP_LDAP_SSL "support LDAP connection over SSL/TLS" on \
 +		OPENSSL_BASE "use the base system OpenSSL (required by TLS)" on \
 +		OPENSSL_PORT "use OpenSSL from ports (requires by TLS)" off
  .endif
  
  .include <bsd.port.pre.mk>
  
 +.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
 +# Based on patch from Brian Masney :
 +PATCH_SITES=	http://www.newwave.net/~masneyb/
 +PATCHFILES=	${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}-ldap-patch
 +PATCH_DIST_STRIP=	-p1
 +
 +USE_PERL5_RUN=	yes
 +USE_OPENLDAP=	yes
 +
 +.if !defined(WITHOUT_DHCP_LDAP_SSL)
 +USE_OPENSSL=	yes
 +# hack to get bsd.openssl.mk included at this late state
 +.include "${PORTSDIR}/Mk/bsd.openssl.mk"
 +.endif
 +.endif
 +
  # Global variables
  #
  
 @@ -102,6 +122,9 @@
  PATCH_SUBDIRS+=	omshell
  .endif
  
 +.if !defined(NOPORTDOCS)
 +PORTDOCS=	LICENSE README RELNOTES
 +.endif
  .if ${SUBSYS} == client
  BIN_FILES=	dhclient
  CONF_FILES=	dhclient.conf
 @@ -112,21 +135,30 @@
  RC_FILES=	isc-dhcpd
  SAMP_FILES=	server/dhcpd.conf
  DATA_FILES=	dhcpd.leases
 +.if defined(WITH_DHCP_LDAP)
 +PORTDOCS+=	README.ldap
 +LDAP_SCRIPT=	contrib/dhcpd-conf-to-ldap.pl
 +LDAP_SCHEMA=	contrib/dhcp.schema
 +.endif
  .elif ${SUBSYS} == relay
  BIN_FILES=	dhcrelay
  RC_FILES=	isc-dhcrelay
  .endif
 -.if !defined(NOPORTDOCS)
 -PORTDOCS=	LICENSE README RELNOTES
 -.endif
  
  SAMP_SUFX=	.sample
  
  CONF_DIR=	${PREFIX}/etc
  RC_DIR=		${PREFIX}/etc/rc.d
 +SCHEMA_DIR=	${PREFIX}/share/${PKGBASE}
  DOCSDIR=	${PREFIX}/share/doc/${PKGBASE}
  DATADIR=	/var/db
  
 +PLIST_SUB+=	SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}"
 +.if defined(WITH_DHCP_LDAP)
 +PLIST_SUB+=	LDAP=""
 +.else
 +PLIST_SUB+=	LDAP="@comment "
 +.endif
  REINPLACE_SUB=	PREFIX=${PREFIX}
  RCSCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
  .if !defined(WITHOUT_DHCP_PARANOIA)
 @@ -139,7 +171,8 @@
  .else
  RCSCRIPTS_SUB+=	JAIL=NO
  .endif
 -PKGMESSAGE_SUB=	PREFIX=${PREFIX} MAN1PREFIX=${MAN1PREFIX}
 +PKGMESSAGE_SUB=	PREFIX="${PREFIX}" MAN1PREFIX="${MAN1PREFIX}" \
 +		DOCSDIR="${DOCSDIR}" SCHEMA_DIR="${SCHEMA_DIR}"
  
  # Post-extract
  #
 @@ -179,6 +212,15 @@
  .if !defined(WITHOUT_DHCP_JAIL)
  	@${ECHO_CMD} CFLAGS += -DJAIL >> ${WRKSRC}/site.conf
  .endif
 +.if defined(WITH_DHCP_LDAP)
 +	@${ECHO_CMD} CFLAGS += -I${LOCALBASE}/include >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -L${LOCALBASE}/lib >> ${WRKSRC}/site.conf
 +.if !defined(WITHOUT_DHCP_LDAP_SSL)
 +	@${ECHO_CMD} CFLAGS += -DUSE_SSL -I${OPENSSLINC} >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -L${OPENSSLLIB} >> ${WRKSRC}/site.conf
 +	@${ECHO_CMD} LIBS += -lcrypto -lssl >> ${WRKSRC}/site.conf
 +.endif
 +.endif
  .endif
  
  patch-makefile-conf:
 @@ -205,6 +247,11 @@
  .if ${SUBSYS} != devel
  	@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
  		${MSG_FILE} > ${PKGMESSAGE}
 +.if defined(WITH_DHCP_LDAP)
 +	@${REINPLACE_CMD} -e 's|^%%LDAP%%||g' ${PKGMESSAGE}
 +.else
 +	@${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE}
 +.endif
  .endif
  
  # Post-install
 @@ -216,7 +263,7 @@
  
  parallel-post-install: \
  	strip-binary-files install-startup-files \
 -	install-doc-files install-sample-files \
 +	install-doc-files install-ldap-files install-sample-files \
  	create-conf-files create-data-files
  
  strip-binary-files:
 @@ -240,6 +287,13 @@
  .for f in ${PORTDOCS}
  	@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
  .endfor
 +.endif
 +
 +install-ldap-files:
 +.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
 +	@${INSTALL_SCRIPT} ${WRKSRC}/${LDAP_SCRIPT} ${PREFIX}/bin
 +	@${MKDIR} ${SCHEMA_DIR}
 +	@${INSTALL_DATA} ${WRKSRC}/${LDAP_SCHEMA} ${SCHEMA_DIR}
  .endif
  
  install-sample-files:
 Index: distinfo
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/distinfo,v
 retrieving revision 1.47
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.47 distinfo
 --- distinfo	25 Jun 2004 18:50:13 -0000	1.47
 +++ distinfo	14 Sep 2004 15:45:52 -0000
 @@ -1,2 +1,4 @@
  MD5 (dhcp-3.0.1rc14.tar.gz) = a68074d9ebdeb355c293d9b3645b3c2c
  SIZE (dhcp-3.0.1rc14.tar.gz) = 842712
 +MD5 (dhcp-3.0.1rc14-ldap-patch) = 38fde70e0f27758da2be70ce46c17f8b
 +SIZE (dhcp-3.0.1rc14-ldap-patch) = 152494
 Index: pkg-message
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-message,v
 retrieving revision 1.7
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.7 pkg-message
 --- pkg-message	18 Aug 2004 09:31:58 -0000	1.7
 +++ pkg-message	14 Sep 2004 15:45:52 -0000
 @@ -39,3 +39,7 @@
        variables are still read there but should be moved /etc/rc.conf or
        /etc/rc.conf.d/dhcpd instead.  Also, the dhcpd_options variable must
        be renamed dhcpd_flags if any.
 +%%LDAP%%
 +%%LDAP%%****  You have requested support for the LDAP configuration backend.
 +%%LDAP%%      The OpenLDAP schema file is installed as %%SCHEMA_DIR%%/dhcp.schema.
 +%%LDAP%%      See %%DOCSDIR%%/README.ldap for further LDAP configuration details.
 Index: pkg-plist
 ===================================================================
 RCS file: /home/ncvs/ports/net/isc-dhcp3-server/pkg-plist,v
 retrieving revision 1.29
 diff -u -I$Id.*$ -I$.+BSD.*$ -r1.29 pkg-plist
 --- pkg-plist	26 Jun 2004 14:32:40 -0000	1.29
 +++ pkg-plist	14 Sep 2004 15:45:52 -0000
 @@ -1,5 +1,8 @@
  @comment $FreeBSD: ports/net/isc-dhcp3-server/pkg-plist,v 1.29 2004/06/26 14:32:40 eik Exp $
  bin/omshell
 +%%LDAP%%bin/dhcpd-conf-to-ldap.pl
  etc/dhcpd.conf.sample
  etc/rc.d/isc-dhcpd.sh
  sbin/dhcpd
 +%%LDAP%%%%SCHEMA_DIR%%/dhcp.schema
 +%%LDAP%%@dirrm %%SCHEMA_DIR%%
 
 Cyrille Lefevre
 -- 
 mailto:cyrille.lefevre@laposte.net
State-Changed-From-To: feedback->closed 
State-Changed-By: edwin 
State-Changed-When: Wed Oct 13 00:15:04 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71030 
>Unformatted:
