summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kalika <max@gentoo.org>2003-07-23 17:18:44 +0000
committerMax Kalika <max@gentoo.org>2003-07-23 17:18:44 +0000
commitbefde72de3e5711b20d61bdea80b1c45ac7c225d (patch)
tree8cad9555dddb6761fe3b802cc3f25dcb3ec7b50b /net-misc/dhcp
parentMarked stable on hppa. (diff)
downloadgentoo-2-befde72de3e5711b20d61bdea80b1c45ac7c225d.tar.gz
gentoo-2-befde72de3e5711b20d61bdea80b1c45ac7c225d.tar.bz2
gentoo-2-befde72de3e5711b20d61bdea80b1c45ac7c225d.zip
Add support for the dhcp paranoia patch. Fixes bug #24487.
Diffstat (limited to 'net-misc/dhcp')
-rw-r--r--net-misc/dhcp/ChangeLog11
-rw-r--r--net-misc/dhcp/Manifest12
-rw-r--r--net-misc/dhcp/dhcp-3.0_p2-r1.ebuild134
-rw-r--r--net-misc/dhcp/files/dhcp.conf16
-rw-r--r--net-misc/dhcp/files/dhcp.rc531
-rw-r--r--net-misc/dhcp/files/dhcp.rc621
-rw-r--r--net-misc/dhcp/files/digest-dhcp-3.0_p2-r12
7 files changed, 181 insertions, 46 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog
index 0f8fd73fbd80..fcb422f78ec3 100644
--- a/net-misc/dhcp/ChangeLog
+++ b/net-misc/dhcp/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-misc/dhcp
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.16 2003/03/01 19:38:54 weeve Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.17 2003/07/23 17:18:30 max Exp $
+
+*dhcp-3.0_p2-r1 (23 Jul 2003)
+
+ 23 Jul 2003; Max Kalika <max@gentoo.org> dhcp-3.0_p2-r1.ebuild,
+ files/dhcp.conf, files/dhcp.rc5, files/dhcp.rc6:
+ Add support for the dhcp-paranoia patch which allows to run the server
+ chrooted and under a different user/group id. Remove unused dhcp.rc5 file.
+ Create a new startup script and dub it dhcp.rc6 as that file isn't currently
+ used by anything. Other various cleanups.
17 Jan 2003; Daniel Ahlberg <aliz@gentoo.org> dhcp-3.0_p2.ebuild :
Unmasked, security update.
diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index 106bb0871c01..4a953cf3c7d6 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -1,10 +1,12 @@
-MD5 2511eeb679463053f5d029c6a585093e ChangeLog 2806
+MD5 5aa0613e3216b73bf599da2d1ac467a7 dhcp-3.0_p2-r1.ebuild 3490
MD5 aeb5f3de67ad8641b4431ce7dce6c032 dhcp-3.0_p1.ebuild 2519
+MD5 643d8bb0b296f78f6e1e4ae9e1e53ebf ChangeLog 3226
MD5 e796fd5f6453e7373690396ff143e77d dhcp-3.0_p2.ebuild 2740
-MD5 ff4bf18624d479599da15878fdef65fe files/conf.dhcpd 401
+MD5 f374815f3e984f10b69982edb4319485 files/dhcp.conf 646
MD5 498a3eb0e9deaf705f17fff3834f5b90 files/dhclient.c-3.0-dw-cli-fix.patch 734
-MD5 67491828f0644bf69f260dfa866df68f files/dhcp.rc5 522
-MD5 50370b0fbf7ed7311175860e5a4fe67b files/dhcp.rc6 738
-MD5 3b8b1f6fd55b12c763d385ceba9762af files/dhcp.rc7 800
+MD5 ff4bf18624d479599da15878fdef65fe files/conf.dhcpd 401
MD5 4be1d9436727ac6b0c9e780b71f81fc9 files/digest-dhcp-3.0_p1 63
MD5 d6ae01f5dcc87b11d4d96a34e7cc52a3 files/digest-dhcp-3.0_p2 63
+MD5 a941fa952582373e42b07b61bd66a168 files/digest-dhcp-3.0_p2-r1 129
+MD5 40315300d644c3f738f6a9f227eba231 files/dhcp.rc6 786
+MD5 3b8b1f6fd55b12c763d385ceba9762af files/dhcp.rc7 800
diff --git a/net-misc/dhcp/dhcp-3.0_p2-r1.ebuild b/net-misc/dhcp/dhcp-3.0_p2-r1.ebuild
new file mode 100644
index 000000000000..77682711040a
--- /dev/null
+++ b/net-misc/dhcp/dhcp-3.0_p2-r1.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.0_p2-r1.ebuild,v 1.1 2003/07/23 17:18:30 max Exp $
+
+inherit flag-o-matic
+
+IUSE=""
+DESCRIPTION="ISC Dynamic Host Configuration Protocol."
+HOMEPAGE="http://www.isc.org/products/DHCP"
+
+MY_P="${P/_p/pl}"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ http://www.episec.com/people/edelkind/patches/dhcp/dhcp-3.0+paranoia.patch"
+
+LICENSE="isc-dhcp"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips"
+
+DEPEND="virtual/glibc
+ sys-apps/groff"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+
+ unpack ${A}
+
+ cd "${S}"
+
+ epatch "${FILESDIR}/dhclient.c-3.0-dw-cli-fix.patch"
+ epatch "${DISTDIR}/dhcp-3.0+paranoia.patch"
+
+}
+
+src_compile() {
+
+ # 01/Mar/2003: Fix for bug #11960 by Jason Wever <weeve@gentoo.org>
+ if [ "${ARCH}" = "sparc" ] ; then
+ filter-flags "-O3"
+ filter-flags "-O2"
+ filter-flags "-O"
+ fi
+
+ cat <<-END >> includes/site.h
+ #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
+ #define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
+ #define _PATH_DHCPD_DB "/var/lib/dhcp/dhcpd.leases"
+ #define DHCPD_LOG_FACILITY LOG_LOCAL1
+ END
+
+ cat <<-END > site.conf
+ CC = gcc ${CFLAGS}
+ LIBDIR = /usr/lib
+ INCDIR = /usr/include
+ ETC = /etc/dhcp
+ VARDB = /var/lib/dhcp
+ ADMMANDIR = /usr/share/man/man8
+ FFMANDIR = /usr/share/man/man5
+ LIBMANDIR = /usr/share/man/man3
+ USRMANDIR = /usr/share/man/man1
+ END
+
+ ./configure --with-nsupdate \
+ --copts "-DPARANOIA -DEARLY_CHROOT" || die "configure failed"
+
+ emake || die "compile problem"
+
+}
+
+src_install() {
+
+ enewgroup dhcp
+ enewuser dhcp -1 /bin/false /var/lib/dhcp dhcp
+
+ einstall DESTDIR="${D}"
+
+ insinto /etc/dhcp
+ newins server/dhcpd.conf dhcpd.conf.sample
+ newins client/dhclient.conf dhclient.conf.sample
+ dosed "s:/etc/dhclient-script:/etc/dhcp/dhclient-script:" /etc/dhcp/dhclient.conf.sample
+ mv "${D}/sbin/dhclient-script" "${D}/etc/dhcp/dhclient-script.sample"
+
+ dodoc ANONCVS CHANGES COPYRIGHT README RELNOTES doc/*
+ newdoc client/dhclient.conf dhclient.conf.sample
+ newdoc client/scripts/linux dhclient-script.sample
+ newdoc server/dhcpd.conf dhcpd.conf.sample
+
+ touch "${D}/var/lib/dhcp/dhclient.leases"
+ touch "${D}/var/lib/dhcp/dhcpd.leases"
+
+ insinto /etc/conf.d
+ newins "${FILESDIR}/dhcp.conf" dhcp
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/dhcp.rc6" dhcp
+
+}
+
+pkg_postinst() {
+
+ einfo "You can edit /etc/conf.d/dhcp to customize dhcp settings"
+ einfo
+ einfo "The DHCP ebuild now includes chroot support."
+ einfo "If you like to run dhcpd in chroot AND this is a new install OR"
+ einfo "your dhcpd doesn't already run in chroot, simply run:"
+ einfo " ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
+ einfo "Before running the above command you might want to change the chroot"
+ einfo "dir in /etc/conf.d/dhcp, otherwise /chroot/dhcp will be used."
+ echo
+
+}
+
+pkg_config() {
+
+ CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/dhcp 2>/dev/null`
+
+ if [ ! -d "${CHROOT:=/chroot/dhcp}" ] ; then
+ ebegin "Setting up the chroot directory"
+ mkdir -m 0755 -p "${CHROOT}/etc" "${CHROOT}/var/lib"
+ cp -R /etc/dhcp "${CHROOT}/etc/"
+ cp -R /var/lib/dhcp "${CHROOT}/var/lib"
+ chown -R dhcp:dhcp "${CHROOT}/var/lib"
+ eend
+
+ if [ "`grep '^#[[:blank:]]\?CHROOT' /etc/conf.d/dhcp`" ] ; then
+ sed -e '/^#[[:blank:]]\?CHROOT/s/^#[[:blank:]]\?//' -i /etc/conf.d/dhcp
+ fi
+ else
+ eerror
+ eerror "${CHROOT} already exists. Quitting."
+ eerror
+ fi
+
+}
diff --git a/net-misc/dhcp/files/dhcp.conf b/net-misc/dhcp/files/dhcp.conf
new file mode 100644
index 000000000000..5b4830fddb9b
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp.conf
@@ -0,0 +1,16 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.conf,v 1.1 2003/07/23 17:18:30 max Exp $
+
+#configure which interface or interfaces to for dhcp to listen on
+#list all interfaces space separated.
+IFACE="eth0"
+
+# Insert any other options needed
+DHCPD_OPTS=""
+
+# If you wish to run dhcp in a chroot, run:
+# ebuild /var/db/pkg/net-misc/<dhcp version>/<dhcp-version>.ebuild config
+# and un-comment the following line.
+# You can specify a different chroot directory but MAKE SURE it's empty.
+#CHROOT="/chroot/dhcp"
diff --git a/net-misc/dhcp/files/dhcp.rc5 b/net-misc/dhcp/files/dhcp.rc5
deleted file mode 100644
index b23298be6cb2..000000000000
--- a/net-misc/dhcp/files/dhcp.rc5
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#RCUPDATE:3 4:71:This line is required for script management
-
-source /etc/rc.d/config/functions
-
-SERVICE=dhcpd
-opts="start stop restart"
-
-EXE=/usr/sbin/dhcpd
-
-start() {
- ebegin "Starting $SERVICE"
- start-stop-daemon --start --quiet --exec $EXE -- eth0
- eend $? "Started $SERVICE." "Error Starting $SERVICE."
-}
-
-stop() {
- ebegin "Stopping $SERVICE"
- start-stop-daemon --stop --quiet --exec $EXE
- eend $? "Stopped $SERVICE." "Error Stopping $SERVICE."
-}
-
-restart() {
-
- stop
- start
-}
-
-doservice ${@}
-
-
diff --git a/net-misc/dhcp/files/dhcp.rc6 b/net-misc/dhcp/files/dhcp.rc6
index 84334dfee9bd..d152d857e9fc 100644
--- a/net-misc/dhcp/files/dhcp.rc6
+++ b/net-misc/dhcp/files/dhcp.rc6
@@ -1,24 +1,27 @@
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.rc6,v 1.3 2003/02/14 23:05:15 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.rc6,v 1.4 2003/07/23 17:18:30 max Exp $
depend() {
- need net
+ need net
+ use logger
}
checkconfig() {
- if [ ! -e /etc/dhcp/dhcpd.conf ] ; then
- eerror "You need an /etc/dhcp/dhcpd.conf file to run dhcpd"
- eerror "There is a sample conf file in /usr/share/doc/dhcp"
- return 1
- fi
+ if [ ! -f "${CHROOT}/etc/dhcp/dhcpd.conf" ] ; then
+ eerror "No ${CHROOT}/etc/dhcp/dhcpd.conf file exists!"
+ return 1
+ fi
}
start() {
checkconfig || return 1
- ebegin "Starting dhcpd"
- start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd -- eth0
+
+ ebegin "Starting ${CHROOT:+chrooted }dhcpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd \
+ -- -user dhcp -group dhcp ${DHCPD_OPTS} \
+ ${CHROOT:+-chroot ${CHROOT}} ${IFACE}
eend $?
}
diff --git a/net-misc/dhcp/files/digest-dhcp-3.0_p2-r1 b/net-misc/dhcp/files/digest-dhcp-3.0_p2-r1
new file mode 100644
index 000000000000..5c34b82115a3
--- /dev/null
+++ b/net-misc/dhcp/files/digest-dhcp-3.0_p2-r1
@@ -0,0 +1,2 @@
+MD5 2cb5db7a0c23deaef4724b5fc3f9a869 dhcp-3.0pl2.tar.gz 865196
+MD5 66becf9870e0293bbd35d1fba770751a dhcp-3.0+paranoia.patch 5366