rpms/bind/devel bind-chroot-admin.in, 1.2, 1.3 bind.spec, 1.93, 1.94 named.caching-nameserver.conf, 1.1, 1.2

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Mar 8 18:17:58 UTC 2006


Author: jvdias

Update of /cvs/dist/rpms/bind/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12835

Modified Files:
	bind-chroot-admin.in bind.spec named.caching-nameserver.conf 
Log Message:
- Do not allow package to be installed if named:25 userid creation fails
- Give libbind a pkg-config file
- remove restorecon from bind-chroot-admin (not required).
- fix named.caching-nameserver.conf (listen-on-v6 port 53 { ::1 };)



Index: bind-chroot-admin.in
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/bind-chroot-admin.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- bind-chroot-admin.in	8 Mar 2006 00:42:02 -0000	1.2
+++ bind-chroot-admin.in	8 Mar 2006 18:17:55 -0000	1.3
@@ -85,7 +85,7 @@
     [ ! -e "${BIND_CHROOT_PREFIX}/dev/null" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/null" c 1 3
     [ ! -e "${BIND_CHROOT_PREFIX}/etc/localtime" ] &&  [ -e /etc/localtime ] && /bin/cp -fp /etc/localtime "${BIND_CHROOT_PREFIX}/etc/localtime";
     chmod 666 "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
-    if [ -d /selinux ] && [ -x /usr/bin/chcon ]; then       
+    if [ -d /selinux ] && [ -e /selinux/enforce ] && [ -x /usr/bin/chcon ]; then       
        for dev in random zero null; do
 	   /usr/bin/chcon --reference=/dev/$dev ${BIND_CHROOT_PREFIX}/dev/$dev;
        done
@@ -222,8 +222,7 @@
     chmod 640 ${pfx}/var/named/* >/dev/null 2>&1;
     chown named:named ${pfx}/var/named/{data{,/*},slaves{,*/}} >/dev/null 2>&1;
     chmod 770 ${pfx}/var/named/{data,slaves} >/dev/null 2>&1;
-    chmod 640 ${pfx}/var/named/{data/*,slaves/*} >/dev/null 2>&1; 
-    [ -x /sbin/restorecon ] && /sbin/restorecon -R $pfx{/var/named,/etc/{named,rndc}.*}  -e ${BIND_CHROOT_PREFIX}/proc -e ${BIND_CHROOT_PREFIX}/var/run/dbus -e ${BIND_CHROOT_PREFIX}/dev >/dev/null 2>&1;
+    chmod 640 ${pfx}/var/named/{data/*,slaves/*} >/dev/null 2>&1;
 }
 
 case $1 in 


Index: bind.spec
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/bind.spec,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- bind.spec	8 Mar 2006 00:42:02 -0000	1.93
+++ bind.spec	8 Mar 2006 18:17:55 -0000	1.94
@@ -7,6 +7,8 @@
 %{?!test:       %define test        0}
 %{?!WITH_DBUS:  %define WITH_DBUS   1} # + dynamic forwarder table management with D-BUS 
 %{?!DEBUGINFO:  %define DEBUGINFO   1}
+%{?!bind_uid:   %define bind_uid   25}
+%{?!bind_gid:   %define bind_gid   25}
 %define		bind_dir      /var/named
 %define    	chroot_prefix %{bind_dir}/chroot
 #
@@ -14,7 +16,7 @@
 Name: 		bind
 License: 	BSD-like
 Version: 	9.3.2
-Release: 	7
+Release: 	8
 Epoch:   	30
 Url: 		http://www.isc.org/products/BIND/
 Buildroot: 	%{_tmppath}/%{name}-root
@@ -48,6 +50,7 @@
 Source25: 	rfc1912.txt
 Source26: 	bind-chroot-admin.in
 Source27:       named.rfc1912.zones
+Source28:	libbind.pc
 #
 Patch:  	bind-9.2.0rc3-varrun.patch
 Patch1: 	bind-9.3.2b2-rndckey.patch
@@ -164,6 +167,7 @@
 bind, bind-libs, and bind-utils along with this package.  
 This package replaces the caching-nameserver package.
 
+
 %package   chroot
 Summary:   A chroot runtime environment for the ISC BIND DNS server, named(8)
 Group: 	   System Environment/Daemons
@@ -385,7 +389,10 @@
 cp -fp %{SOURCE12} contrib/sdb/pgsql/
 %endif
 %if %{LIBBIND}
-gunzip < %{SOURCE9} | (cd $RPM_BUILD_ROOT/usr/share; tar -xpf -) 
+gunzip < %{SOURCE9} | (cd $RPM_BUILD_ROOT/usr/share; tar -xpf -)
+mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
+cp -fp %{SOURCE28} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/libbind.pc
+chmod 644 $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/libbind.pc
 %endif
 %if %{WITH_DBUS}
 mkdir -p $RPM_BUILD_ROOT/etc/dbus-1/system.d
@@ -583,6 +590,7 @@
 %files libbind-devel
 %defattr(-,root,root)
 %{_libdir}/libbind.*
+%{_libdir}/pkgconfig/libbind.pc
 %{_includedir}/bind
 %{_mandir}/man3/libbind-*
 %{_mandir}/man7/libbind-*
@@ -607,16 +615,15 @@
 
 %pre
 if [ "$1" -eq 1 ]; then
-   # create named group IFF it does not already exist 
-   # - use any free ID between 1 and 499 if group 25 exists:
-   /usr/sbin/groupadd -g 25 -f -r named >/dev/null 2>&1 || :;
-   # if named user does not already exist, create it as system user:
-   if ! /usr/bin/id -u named > /dev/null 2>&1; then
-      if ! /bin/egrep -q '^[^:]+:[^:]+:25:' /etc/passwd >/dev/null 2>&1 ; then
-         /usr/sbin/useradd -u 25 -r -n -M -g named -s /sbin/nologin -d /var/named -c Named named >/dev/null 2>&1 || :;
-      else
-         # use any free ID between 1 and 499:
-         /usr/sbin/useradd -r -n -M -g named -s /sbin/nologin -d /var/named -c Named named >/dev/null 2>&1 || :;
+   /usr/sbin/groupadd -g %{bind_gid} -f -r named >/dev/null 2>&1 || :;
+   if ! /usr/sbin/useradd -u %{bind_uid} -r -n -M -g named -s /sbin/nologin -d /var/named -c Named named >/dev/null 2>&1; then
+      if ! /usr/bin/id -u named >/dev/null 2>&1; then
+	 echo 'Creation of named userid '%{bind_uid}' failed.'
+	 echo 'The bind package cannot be installed without a named:named userid and group.'
+	 if [ -x /usr/bin/logger ]; then
+	    /usr/bin/logger -p 'user.crit' 'Creation of named userid '%{bind_uid}' failed - the bind package cannot be installed without a named:named userid and group.';
+	 fi;
+	 exit 1;
       fi;
    fi;
 fi;
@@ -715,7 +722,8 @@
 %post config
 if [ "$1" -gt 0 ]; then
    /usr/bin/chcon system_u:object_r:named_conf_t  /etc/named.caching-nameserver.conf >/dev/null 2>&1 || :;
-elif [ "$1" -eq 1 ]; then
+fi
+if [ "$1" -eq 1 ]; then
    /usr/sbin/bind-chroot-admin --sync;
 fi;
 :;
@@ -796,6 +804,12 @@
 :;
 
 %changelog
+* Wed Mar 08 2006 Jason Vas Dias <jvdias at redhat.com> - 30.9.3.2-8
+- Do not allow package to be installed if named:25 userid creation fails
+- Give libbind a pkg-config file
+- remove restorecon from bind-chroot-admin (not required).
+- fix named.caching-nameserver.conf (listen-on-v6 port 53 { ::1 };)
+
 * Tue Mar 07 2006 Jason Vas Dias <jvdias at redhat.com> - 30:9.3.2-7
 - fix issues with bind-chroot-admin
 


Index: named.caching-nameserver.conf
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/named.caching-nameserver.conf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- named.caching-nameserver.conf	7 Mar 2006 04:25:38 -0000	1.1
+++ named.caching-nameserver.conf	8 Mar 2006 18:17:55 -0000	1.2
@@ -11,6 +11,7 @@
 //
 options {
 	listen-on port 53 { 127.0.0.1; };
+	listen-on-v6 port 53 { ::1; };
 	directory 	"/var/named";
 	dump-file 	"/var/named/data/cache_dump.db";
         statistics-file "/var/named/data/named_stats.txt";




More information about the fedora-cvs-commits mailing list