[mdadm] Fix SELinux directory perms in mdmonitor init script

Doug Ledford dledford at fedoraproject.org
Thu Mar 31 16:33:21 UTC 2011


commit 43ea33bd96c9c268be38296bf8c904b7f09a7b94
Author: Doug Ledford <dledford at redhat.com>
Date:   Thu Mar 31 12:33:07 2011 -0400

    Fix SELinux directory perms in mdmonitor init script
    
    Signed-off-by: Doug Ledford <dledford at redhat.com>

 mdadm.spec     |    6 +++++-
 mdmonitor.init |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/mdadm.spec b/mdadm.spec
index 65cd627..f8469a7 100644
--- a/mdadm.spec
+++ b/mdadm.spec
@@ -1,7 +1,7 @@
 Summary:     The mdadm program controls Linux md devices (software RAID arrays)
 Name:        mdadm
 Version:     3.2.1
-Release:     2%{?dist}
+Release:     3%{?dist}
 Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
 Source1:     mdmonitor.init
 Source2:     raid-check
@@ -80,6 +80,10 @@ fi
 %ghost %attr(0700,root,root) %dir /var/run/mdadm
 
 %changelog
+* Thu Mar 31 2011 Doug Ledford <dledford at redhat.com> - 3.2.1-3
+- Fix mdmonitor init script setup of SELinux on PIDPATH
+- Resolves: bz692559
+
 * Mon Mar 28 2011 Doug Ledford <dledford at redhat.com> - 3.2.1-2
 - Restore build command to sane command instead of test command
 
diff --git a/mdmonitor.init b/mdmonitor.init
index f0d57d9..03f3e95 100755
--- a/mdmonitor.init
+++ b/mdmonitor.init
@@ -56,8 +56,9 @@ start ()
     grep '^\(MAILADDR\|PROGRAM\) .' /etc/mdadm.conf >/dev/null 2>&1 || return 6
     # Create our directory if it isn't there yet
     if [ ! -d $PIDPATH ]; then
-        mkdir -m 0700 -Z system_u:object_r:mdadm_var_run_t $PIDPATH >&/dev/null
+        mkdir -m 0700 $PIDPATH >&/dev/null
 	RC=$?
+	[ -x /sbin/restorecon ] && /sbin/restorecon $PIDPATH
 	if [ $RC -ne 0 ]; then
 	    echo -n "Failed to create /var/run/mdadm"
             failure


More information about the scm-commits mailing list