From 97546f67c9cd5d8af07440fde5f8dee51aa876eb924d9839b41e8291bf13a74b Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 15 Mar 2007 17:17:55 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dhcp?expand=0&rev=4 --- dhcp.changes | 7 +++++++ dhcp.spec | 6 +++++- rc.dhcpd | 16 +++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dhcp.changes b/dhcp.changes index bedf069..9aaca0f 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 15 18:07:35 CET 2007 - mt@suse.de + +- Bug #181212: Improved dhcp init-script to copy directories + specified in the DHCPD_CONF_INCLUDE_FILES sysconfig variable + into the chroot jail. + ------------------------------------------------------------------- Wed Mar 14 12:15:11 CET 2007 - mt@suse.de diff --git a/dhcp.spec b/dhcp.spec index d548c53..71a3cb3 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -23,7 +23,7 @@ License: BSD License and BSD-like Group: Productivity/Networking/Boot/Servers Autoreqprov: on Version: 3.0.5 -Release: 20 +Release: 21 Summary: Common Files Used by ISC DHCP Software URL: http://www.isc.org/isc/dhcp.html Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz @@ -515,6 +515,10 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %doc %{_mandir}/man3/dhcpctl.3.gz %changelog +* Thu Mar 15 2007 - mt@suse.de +- Bug #181212: Improved dhcp init-script to copy directories + specified in the DHCPD_CONF_INCLUDE_FILES sysconfig variable + into the chroot jail. * Wed Mar 14 2007 - mt@suse.de - Bug #247365: Added installation of dhcp-server SuSEfirewall2 service definition file. diff --git a/rc.dhcpd b/rc.dhcpd index 8e9f21f..5ad757f 100644 --- a/rc.dhcpd +++ b/rc.dhcpd @@ -160,18 +160,24 @@ case "$1" in ## copy the conf file to the chroot jail (dhcpd has to be restarted anyway, ## when it has changed) and change path to leases file for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES; do - test -d $CHROOT_PREFIX/${i%/*} || mkdir -p $CHROOT_PREFIX/${i%/*} + if test -d "${i}" ; then + test -d "$CHROOT_PREFIX/${i}" || \ + mkdir -p "$CHROOT_PREFIX/${i}" + elif test -e "${i}" ; then + test -d "$CHROOT_PREFIX/${i%/*}" || \ + mkdir -p "$CHROOT_PREFIX/${i%/*}" + fi done rm -f $CHROOT_PREFIX/dev/urandom for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES /etc/{resolv.conf,host.conf,hosts,localtime} /dev/urandom; do - if ! test -e $i; then continue; fi # neither of them is absolutely necessary - cp -aL $i $CHROOT_PREFIX/$i &>/dev/null \ + if ! test -e "$i"; then continue; fi # neither of them is absolutely necessary + cp -aL "$i" "$CHROOT_PREFIX/${i%/*}/" &>/dev/null \ || { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; } done libdir=/$(basename $(echo /var/lib/dhcp/lib*)) for i in /$libdir/{libresolv.so.2,libnss_dns{,6}.so.2}; do - if [ -s $i ]; then - cp -pL $i /var/lib/dhcp/$libdir/ \ + if [ -s "$i" ]; then + cp -pL "$i" "/var/lib/dhcp/$libdir/" \ || { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; } fi done