Description: init script patches
 All changes related to init scripts
Author: Russell Coker <russell@coker.com.au>

---
Last-Update: 2012-02-28

--- policycoreutils-2.1.10.orig/scripts/fixfiles
+++ policycoreutils-2.1.10/scripts/fixfiles
@@ -207,12 +207,12 @@ if [ ! -z "$PREFC" ]; then
 fi
 if [ ! -z "$RPMFILES" ]; then
     for i in `echo "$RPMFILES" | sed 's/,/ /g'`; do
-	rpmlist $i | ${RESTORECON} ${FORCEFLAG} $* -R -i -f - 2>&1 | cat >> $LOGFILE
+	rpmlist $i | ${RESTORECON} -p ${FORCEFLAG} $* -R -i -f - 2>&1 | cat >> $LOGFILE
     done
     exit $?
 fi
 if [ ! -z "$FILEPATH" ]; then
-    ${RESTORECON} ${FORCEFLAG} -R $* $FILEPATH 2>&1 | cat >> $LOGFILE
+    ${RESTORECON} -p ${FORCEFLAG} -R $* $FILEPATH 2>&1 | cat >> $LOGFILE
     return
 fi
 [ -x /usr/sbin/genhomedircon ] && /usr/sbin/genhomedircon
--- policycoreutils-2.1.10.orig/sandbox/sandbox.config
+++ policycoreutils-2.1.10/sandbox/sandbox.config
@@ -1,2 +1,4 @@
 # Space separate list of homedirs
 HOMEDIRS="/home"
+# Comment out the following line to enable the sandbox
+RUN=NO
--- policycoreutils-2.1.10.orig/sandbox/Makefile
+++ policycoreutils-2.1.10/sandbox/Makefile
@@ -1,7 +1,7 @@
 # Installation directories.
 PREFIX ?= $(DESTDIR)/usr
-INITDIR ?= $(DESTDIR)/etc/rc.d/init.d/
-SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
+INITDIR ?= $(DESTDIR)/etc/init.d/
+SYSCONFDIR ?= $(DESTDIR)/etc/default
 LIBDIR ?= $(PREFIX)/lib
 BINDIR ?= $(PREFIX)/bin
 SBINDIR ?= $(PREFIX)/sbin
--- policycoreutils-2.1.10.orig/restorecond/Makefile
+++ policycoreutils-2.1.10/restorecond/Makefile
@@ -7,7 +7,7 @@ AUTOSTARTDIR = $(DESTDIR)/etc/xdg/autost
 DBUSSERVICEDIR = $(DESTDIR)/usr/share/dbus-1/services
 
 autostart_DATA = sealertauto.desktop
-INITDIR = $(DESTDIR)/etc/rc.d/init.d
+INITDIR = $(DESTDIR)/etc/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
 DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include
@@ -31,7 +31,6 @@ install: all
 	install -m 755 restorecond $(SBINDIR)
 	install -m 644 restorecond.8 $(MANDIR)/man8
 	-mkdir -p $(INITDIR)
-	install -m 755 restorecond.init $(INITDIR)/restorecond
 	-mkdir -p $(SELINUXDIR)
 	install -m 644 restorecond.conf $(SELINUXDIR)/restorecond.conf
 	install -m 644 restorecond_user.conf $(SELINUXDIR)/restorecond_user.conf
--- policycoreutils-2.1.10.orig/restorecond/restorecond.init
+++ policycoreutils-2.1.10/restorecond/restorecond.init
@@ -1,16 +1,16 @@
 #!/bin/sh
-#
-# restorecond:		Daemon used to maintain path file context
-#
-# chkconfig:	- 12 87
-# description:	restorecond uses inotify to look for creation of new files \
-# listed in the /etc/selinux/restorecond.conf file, and restores the \
-# correct security context.
-#
-# processname: /usr/sbin/restorecond
-# config: /etc/selinux/restorecond.conf 
-# pidfile: /var/run/restorecond.pid
-#
+### BEGIN INIT INFO
+# Provides:          restorecond
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Daemon used to maintain path file context
+# Description:       uses inotify to look for creation of new files
+#                    listed in the /etc/selinux/restorecond.conf file, 
+#                    and restores the correct security context.
+### END INIT INFO
+
 # Return values according to LSB for all commands but status:
 # 0 - success
 # 1 - generic or unspecified error
--- policycoreutils-2.1.10.orig/mcstrans/src/mcstrans.init
+++ policycoreutils-2.1.10/mcstrans/src/mcstrans.init
@@ -1,4 +1,15 @@
 #!/bin/bash
+### BEGIN INIT INFO
+# Provides:          mcstransd
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: The daemon to make sensitivity labels human readable form
+# Description:       This daemon maps machine readable sensitivity labels
+#                    (numbered levels and categories) to a human readable form
+#                    (arbitrary names assigned by the sysadmin).
+### END INIT INFO
 #
 # mcstransd        This starts and stops mcstransd
 #
@@ -6,7 +17,6 @@
 # description: This starts the SELinux Context Translation System Daemon
 #
 # processname: /sbin/mcstransd
-# pidfile: /var/run/mcstransd.pid
 #
 # Return values according to LSB for all commands but status:
 # 0 - success
@@ -20,10 +30,12 @@
 
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
 prog="mcstransd"
-lockfile=/var/lock/subsys/$prog
+lockfile=/var/lock/$prog
 
-# Source function library.
-. /etc/init.d/functions
+# Get lsb functions
+. /lib/lsb/init-functions
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
 
 # Allow anyone to run status
 if [ "$1" = "status" ] ; then
@@ -43,15 +55,14 @@ RETVAL=0
 start(){
 	test -x /sbin/mcstransd  || exit 5
 	echo -n $"Starting $prog: "
-	if status $prog > /dev/null; then
-		echo -n $"$prog: already running"
-		failure
-		echo
-		return 1
+
+	if ! [ -d /var/run/setrans ]; then
+		rm -rf /var/run/setrans
+		install -d -o root -g root /var/run/setrans
 	fi
 
 	unset HOME MAIL USER USERNAME
-	daemon $prog "$EXTRAOPTIONS"
+	start-stop-daemon --start --quiet --exec /sbin/mcstransd -- "$EXTRAOPTIONS"
 	RETVAL=$?
 	echo
 	if test $RETVAL = 0 ; then
@@ -62,7 +73,7 @@ start(){
 
 stop(){
 	echo -n $"Stopping $prog: "
-	killproc $prog
+	killall $prog
 	RETVAL=$?
 	echo
 	rm -f $lockfile
