summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Tkac <atkac@fedoraproject.org>2007-02-15 15:46:08 +0000
committerAdam Tkac <atkac@fedoraproject.org>2007-02-15 15:46:08 +0000
commit75ca0205c3a7be638dbc16c66f974ce36e391857 (patch)
treefe5a6aac3bce00d1a5ea2e02c1f297d439f6cd90
parent564efa6711d70365c2310bfb9111e6f9a08157ea (diff)
downloadbind-75ca0205c3a7be638dbc16c66f974ce36e391857.tar.gz
bind-75ca0205c3a7be638dbc16c66f974ce36e391857.tar.xz
bind-75ca0205c3a7be638dbc16c66f974ce36e391857.zip
Minor cleanup in bind-chroot-admin script
-rw-r--r--bind-chroot-admin.in30
-rw-r--r--bind.spec7
2 files changed, 15 insertions, 22 deletions
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 <atkac@redhat.com> 31:9.3.4-7.fc7
+- minor cleanup in bind-chroot-admin script
+
* Fri Feb 09 2007 Adam Tkac <atkac@redhat.com> 31:9.3.4-6.fc7
- fixed broken bind-chroot-admin script (#227995)