]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/commitdiff
Call restorecon on the socket and pidfile directories to make SELinux
authordon <don@8f7917da-ec0b-0410-a553-b9b0e350d17e>
Wed, 11 Mar 2009 10:46:54 +0000 (10:46 +0000)
committerdon <don@8f7917da-ec0b-0410-a553-b9b0e350d17e>
Wed, 11 Mar 2009 10:46:54 +0000 (10:46 +0000)
happy (thanks to Russel Coker) (closes: #518552)

debian/changelog
debian/spamass-milter.init

index af904ada46d79c0f28ab664361da976c9a5b51c0..f50a73c55204dade0b59a4adad3e2c62f16d3381 100644 (file)
@@ -1,3 +1,10 @@
+spamass-milter (0.3.1-10) UNRELEASED; urgency=low
+
+  * Call restorecon on the socket and pidfile directories to make SELinux
+    happy (thanks to Russel Coker) (closes: #518552)
+
+ -- Don Armstrong <don@debian.org>  Wed, 11 Mar 2009 03:44:35 -0700
+
 spamass-milter (0.3.1-9) unstable; urgency=low
 
   * Document that using the -x option requires being in the smmsp group
index 907f97fdd9423759b3f82943143f4a5f7730ca6d..68d423216a7b5b0b54ab87754a87a18373136fba 100644 (file)
@@ -92,20 +92,19 @@ set -e
 start() {
     # Because the default socket is in the same location as the
     # pidfile, we create them in this order.
-    if [ ! -d $(dirname $PIDFILE) ]; then
-       mkdir -p $(dirname $PIDFILE);
-       if [ -d $(dirname $PIDFILE) ] && [ -n "$RUNAS" ]; then
-           chown "$RUNAS" $(dirname $PIDFILE);
-       fi;
-    fi;
+    for DIR in "$(dirname $PIDFILE)" "$(dirname $SOCKET)"; do 
     # if the dirname is '.', then it's some kind of odd socket, like
     # an inet socket. Don't create the directory in such a case
-    if [ $(dirname $SOCKET) != "." ] && [ ! -d $(dirname $SOCKET) ]; then
-       mkdir -p $(dirname $SOCKET);
-       if [ -n "$SOCKETOWNER" ]; then
-           chown "$RUNAS" $(dirname $SOCKET);
+       if [ "$DIR" != "." ] && [ ! -d "$DIR" ]; then
+           mkdir -p "$DIR";
+           if [ -x /sbin/restorecon ]; then 
+               /sbin/restorecon "$DIR";
+           fi;
+           if [ -n "$RUNAS" ]; then
+               chown "$RUNAS" "$DIR";
+           fi;
        fi;
-    fi;
+    done;
     if [ -n "$RUNAS" ] && [ -d $(dirname $PIDFILE) ] &&
        [ "$(stat -c '%U' $(dirname $PIDFILE))" != "$RUNAS" ]; then
        echo "WARNING: $NAME will run as user $RUNAS but $(dirname $PIDFILE) is not owned by $RUNAS";