diff --git a/bind-chroot-admin.in b/bind-chroot-admin.in index eaf51eb..bdd4a1d 100644 --- a/bind-chroot-admin.in +++ b/bind-chroot-admin.in @@ -279,6 +279,25 @@ function sync_files() fi; } +function clean_root() +{ + if ! rootdir ; 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 || :; + rmdir ${BIND_CHROOT_PREFIX}/etc >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/run/named >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/run >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/named/slaves >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/named/data >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/named >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var/tmp >/dev/null 2>&1 || :; + rmdir ${BIND_CHROOT_PREFIX}/var >/dev/null 2>&1 || :; + fi; + fi; +} + case $1 in -e|--enable) enable_bind_chroot; @@ -290,6 +309,7 @@ case $1 in sync_files; /bin/umount ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :; /bin/umount ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :; + clean_root; exit $?; ;; -s|--sync) diff --git a/bind.spec b/bind.spec index 884479e..64e38ef 100644 --- a/bind.spec +++ b/bind.spec @@ -447,7 +447,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.141 2006/11/03 11:16:52 stransky 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.142 2006/11/03 15:04:41 stransky 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: @@ -784,6 +784,7 @@ rm -rf ${RPM_BUILD_ROOT} - fix for #211282: EDNS is globally enabled, crashing CheckPoint FW-1, added edns-enable options to named configuration file which can suppress EDNS in queries to DNS servers (see /usr/share/doc/bind-9.3.3/misc/options) +- fix for #212961: bind-chroot doesn't clean up its mess on %preun - update to 9.3.3rc3, removed already merged patches * Fri Oct 13 2006 Martin Stransky - 30:9.3.3-5