summaryrefslogtreecommitdiffstats
path: root/bind-chroot-admin.in
diff options
context:
space:
mode:
authorjvdias <jvdias@fedoraproject.org>2006-06-14 05:26:43 +0000
committerjvdias <jvdias@fedoraproject.org>2006-06-14 05:26:43 +0000
commitfc31cdddc1fc21bf418472a50a154854d0946809 (patch)
tree3496c745ffe633b25f5855fb8e67811b1b32bd17 /bind-chroot-admin.in
parent10f5fb7f7005e225d16f4876bdfe26a2fb8dab4e (diff)
downloadbind-fc31cdddc1fc21bf418472a50a154854d0946809.tar.gz
bind-fc31cdddc1fc21bf418472a50a154854d0946809.tar.xz
bind-fc31cdddc1fc21bf418472a50a154854d0946809.zip
fix bugs 191093, 189789; backport selected fixes from upstream v9_3_3b1 CVSbind-9_3_2-26_FC6
Diffstat (limited to 'bind-chroot-admin.in')
-rw-r--r--bind-chroot-admin.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/bind-chroot-admin.in b/bind-chroot-admin.in
index 95e6eca..9395c6e 100644
--- a/bind-chroot-admin.in
+++ b/bind-chroot-admin.in
@@ -50,6 +50,15 @@ function rootdir()
return 1;
}
+function selinux_enabled()
+{
+ [ -e /etc/selinux/config ] && . /etc/selinux/config;
+ if [ -n "$SELINUX" ] && [ "$SELINUX" != 'disabled' ] ; then
+ return 0;
+ fi;
+ return 1;
+}
+
function check_dirs()
{
if [ -z "$BIND_CHROOT_PREFIX" ]; then
@@ -89,7 +98,7 @@ function check_dirs()
[ ! -e "${BIND_CHROOT_PREFIX}/etc/localtime" ] && [ -e /etc/localtime ] && /bin/cp -fp /etc/localtime "${BIND_CHROOT_PREFIX}/etc/localtime";
chown root:named "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
chmod 660 "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
- if [ -d /selinux ] && [ -e /selinux/enforce ] && [ -x /usr/bin/chcon ]; then
+ if selinux_enabled && [ -x /usr/bin/chcon ]; then
for dev in random zero null; do
/usr/bin/chcon --reference=/dev/$dev ${BIND_CHROOT_PREFIX}/dev/$dev;
done
@@ -250,7 +259,7 @@ function sync_files()
chmod 660 ${pfx}/var/named/{data/*,slaves/*} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data/*/.,slaves/*/.} >/dev/null 2>&1;
if [ -e $changed ]; then
- if [ -e /selinux/enforce ] && [ -x /sbin/restorecon ]; then
+ if selinux_enabled && [ -x /sbin/restorecon ]; then
/sbin/restorecon -R ${BIND_CHROOT_PREFIX}/etc ${BIND_CHROOT_PREFIX}/var/named ${BIND_CHROOT_PREFIX}/var/run/named >/dev/null 2>&1;
if [ -e ${BIND_CHROOT_PREFIX}/etc/localtime ] && [ -e /etc/localtime ] ; then
/usr/bin/chcon --reference=/etc/localtime ${BIND_CHROOT_PREFIX}/etc/localtime >/dev/null 2>&1;