[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/bind/devel bind-chroot-admin.in, 1.20, 1.21 bind.spec, 1.179, 1.180



Author: atkac

Update of /cvs/pkgs/rpms/bind/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14536

Modified Files:
	bind-chroot-admin.in bind.spec 
Log Message:
fixed bind-chroot-admin dynamic DNS handling (#239149)



Index: bind-chroot-admin.in
===================================================================
RCS file: /cvs/pkgs/rpms/bind/devel/bind-chroot-admin.in,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- bind-chroot-admin.in	27 Apr 2007 13:59:11 -0000	1.20
+++ bind-chroot-admin.in	15 May 2007 12:17:17 -0000	1.21
@@ -55,11 +55,9 @@
 {
     if [ -x /usr/sbin/selinuxenabled ]; then
       /usr/sbin/selinuxenabled;
-      if [ $? -eq 0 ]; then
-        return 1;
-      fi;
+      return $?;
     fi;
-    return 0;
+    return 1;
 }
 
 function check_dirs()
@@ -209,6 +207,27 @@
     /bin/sed -i -e '/^ROOTDIR=/d' /etc/sysconfig/named;
 }
 
+function master_zone_writes_enabled()
+{
+    if selinux_enabled; then
+	if [ -x /usr/sbin/getsebool ]; then
+	    named_write_master_zones=`/usr/sbin/getsebool named_write_master_zones | cut -d' ' -f3`;
+	    if [ $named_write_master_zones == "on" ]; then
+		return 0;
+	    else
+		return 1;
+	    fi;
+	fi;
+    fi;
+
+    . /etc/sysconfig/named
+    if [ "$ENABLE_ZONE_WRITE" =  [yY1]* ]; then
+	return 0;
+    fi;
+
+    return 1;
+}
+
 function sync_files()
 {
     rootdir;
@@ -248,9 +267,14 @@
 };'     > /etc/rndc.key;
     elif /bin/egrep -q '@KEY@' /etc/rndc.key; then
 	/bin/sed -i -e 's^ KEY@^'`/usr/sbin/dns-keygen`'^' /etc/rndc.key ;
-    fi    
-    chown -h root:named /var/named/* >/dev/null 2>&1;
-    chown -h root:named ${BIND_CHROOT_PREFIX}/var/named/* >/dev/null 2>&1;
+    fi
+    if master_zone_writes_enabled; then
+	chown -h named:named /var/named/* >/dev/null 2>&1;
+	chown -h named:named ${BIND_CHROOT_PREFIX}/var/named/* >/dev/null 2>&1;
+    else
+	chown -h root:named /var/named/* >/dev/null 2>&1;
+	chown -h root:named ${BIND_CHROOT_PREFIX}/var/named/* >/dev/null 2>&1;
+    fi
     chown -h root:named /etc/{named,rndc}.* >/dev/null 2>&1;
     chown -h root:named ${BIND_CHROOT_PREFIX}/etc/{named,rndc}.* >/dev/null 2>&1;
     chmod 750 ${pfx}/var/named  >/dev/null 2>&1;


Index: bind.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bind/devel/bind.spec,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- bind.spec	7 May 2007 10:23:57 -0000	1.179
+++ bind.spec	15 May 2007 12:17:17 -0000	1.180
@@ -808,6 +808,9 @@
 
 
 %changelog
+* Tue May 15 2007 Adam Tkac <atkac redhat com> 31:9.4.1-3.fc7
+- fixed bind-chroot-admin dynamic DNS handling (#239149)
+
 * Mon May 07 2007 Adam Tkac <atkac redhat com> 31:9.4.1-2.fc7
 - test build on new build system
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]