From 8deb4c0e76fb7d34e9c13fa03793ce176dc9bdb9 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Feb 15 2007 15:46:08 +0000 Subject: Minor cleanup in bind-chroot-admin script --- diff --git a/bind-chroot-admin.in b/bind-chroot-admin.in index 695fe00..1140383 100644 --- a/bind-chroot-admin.in +++ b/bind-chroot-admin.in @@ -21,16 +21,6 @@ # # BIND_CHROOT_PREFIX=${BIND_CHROOT_PREFIX:-@BIND_CHROOT_PREFIX@} - -if [ -e /etc/sysconfig/named ]; then - BIND_CHROOT_PREFIX_TEMP=`grep "^\s*ROOTDIR" "/etc/sysconfig/named"` - BIND_CHROOT_PREFIX_TEMP=${BIND_CHROOT_PREFIX_TEMP#*\=} - BIND_CHROOT_PREFIX_TEMP=${BIND_CHROOT_PREFIX_TEMP%#*} - if [ ! ${#BIND_CHROOT_PREFIX_TEMP} -eq 0 ]; then - BIND_CHROOT_PREFIX=$BIND_CHROOT_PREFIX_TEMP - fi -fi - BIND_DIR=${BIND_DIR:-@BIND_DIR@} function usage() @@ -55,11 +45,14 @@ function rootdir() if [ -L "$BIND_CHROOT_PREFIX" ]; then BIND_CHROOT_PREFIX=`/usr/bin/readlink "$BIND_CHROOT_PREFIX"`; fi - return 0; + ENABLED=0; + else + ENABLED=1; fi; - return 1; } +rootdir; + function selinux_enabled() { while read d mp fs rest; do if [ "$fs" = "selinuxfs" ]; then return 0; fi; done < /proc/mounts @@ -69,12 +62,9 @@ function selinux_enabled() function check_dirs() { if [ -z "$BIND_CHROOT_PREFIX" ]; then - rootdir; - if [ -z "$BIND_CHROOT_PREFIX" ]; then - usage; - exit 1; - fi; - fi + usage; + exit 1; + fi; BIND_DIR=`echo $BIND_DIR | sed 's#//*#/#g;s#/$##'`; if [ -L "$BIND_DIR" ]; then BIND_DIR=`/usr/bin/readlink "$BIND_DIR"`; @@ -223,7 +213,7 @@ function sync_files() pfx='' changed=`/bin/mktemp /tmp/XXXXXX`; rm -f $changed - if rootdir ; then # chroot is enabled + if [ $ENABLED -eq 0 ] ; then # chroot is enabled /usr/bin/find /{etc/{named.*,rndc.*},${BIND_DIR#/}{/*,/data/*,/slaves/*}} -maxdepth 0 -type f | while read f; do @@ -291,7 +281,7 @@ function sync_files() function clean_root() { - if ! rootdir ; then # chroot is disabled, clean it up + if [ $ENABLED -eq 0 ] ; then # chroot is disabled, clean it up if [ -n "${BIND_CHROOT_PREFIX}" -a "x${BIND_CHROOT_PREFIX}" != "x/" ]; then rm -r ${BIND_CHROOT_PREFIX}/dev >/dev/null 2>&1 || :; rmdir ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :; diff --git a/bind.spec b/bind.spec index 105b690..1bc6865 100644 --- a/bind.spec +++ b/bind.spec @@ -17,7 +17,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: BSD-like Version: 9.3.4 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 31 Url: http://www.isc.org/products/BIND/ Buildroot: %{_tmppath}/%{name}-root @@ -434,7 +434,7 @@ for f in my.internal.zone.db slaves/my.slave.internal.zone.db slaves/my.ddns.int echo '@ in soa localhost. root 1 3H 15M 1W 1D ns localhost.' > sample/var/named/$f; done -/usr/bin/tail -n '+'`/bin/egrep -n '\\$Id: bind.spec,v 1.162 2007/02/09 14:36:56 atkac Exp $/+1/' | bc` bin/rndc/rndc.conf | sed '/Sample rndc configuration file./{p;i\ +/usr/bin/tail -n '+'`/bin/egrep -n '\\$Id: bind.spec,v 1.163 2007/02/15 15:46:08 atkac Exp $/+1/' | bc` bin/rndc/rndc.conf | sed '/Sample rndc configuration file./{p;i\ *\ * NOTE: you only need to create this file if it is to\ * differ from the following default contents: @@ -744,6 +744,9 @@ rm -rf ${RPM_BUILD_ROOT} :; %changelog +* Thu Feb 15 2007 Adam Tkac 31:9.3.4-7.fc7 +- minor cleanup in bind-chroot-admin script + * Fri Feb 09 2007 Adam Tkac 31:9.3.4-6.fc7 - fixed broken bind-chroot-admin script (#227995)