[cpp-sp] 34/37: Add cache and log dir to shibboleth-sp2-utils with suitable statoverrides

Scott Cantor cantor.2 at osu.edu
Thu Dec 20 19:48:00 EST 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to annotated tag debian/2.5.5+dfsg1-1
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=059b3668bb4bad873c4b79298d5e2c7616ce4363

commit 059b3668bb4bad873c4b79298d5e2c7616ce4363
Author: Ferenc Wágner <wferi at niif.hu>
AuthorDate: Sun Jan 24 22:09:49 2016 +0100

    Add cache and log dir to shibboleth-sp2-utils with suitable statoverrides
    
    Remove these on purge only.
    /var/run/shibboleth is handled by tmpfiles and the init script.
---
 debian/shibboleth-sp2-utils.install  |  1 +
 debian/shibboleth-sp2-utils.postinst | 10 +++++-----
 debian/shibboleth-sp2-utils.postrm   |  9 +++++++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/debian/shibboleth-sp2-utils.install b/debian/shibboleth-sp2-utils.install
index 7f8c540..c37f340 100644
--- a/debian/shibboleth-sp2-utils.install
+++ b/debian/shibboleth-sp2-utils.install
@@ -2,4 +2,5 @@ usr/bin
 usr/lib/*/shibboleth/shibauthorizer
 usr/lib/*/shibboleth/shibresponder
 usr/sbin
+var/cache/shibboleth
 var/log/shibboleth
diff --git a/debian/shibboleth-sp2-utils.postinst b/debian/shibboleth-sp2-utils.postinst
index 41f7294..05e1245 100755
--- a/debian/shibboleth-sp2-utils.postinst
+++ b/debian/shibboleth-sp2-utils.postinst
@@ -9,12 +9,12 @@ if [ "$1" = "configure" ] ; then
         adduser --system --group --quiet --home /var/log/shibboleth \
             --no-create-home --disabled-login --force-badname _shibd
     fi
-fi
 
-# Create the cache directory owned by the shibd user.
-if [ ! -d /var/cache/shibboleth ] ; then
-    mkdir /var/cache/shibboleth
-    chown _shibd:_shibd /var/cache/shibboleth
+    for dir in /var/cache/shibboleth /var/log/shibboleth; do
+        if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
+            dpkg-statoverride --update --add _shibd _shibd 755 "$dir"
+        fi
+    done
 fi
 
 #DEBHELPER#
diff --git a/debian/shibboleth-sp2-utils.postrm b/debian/shibboleth-sp2-utils.postrm
index e5ca865..6577336 100755
--- a/debian/shibboleth-sp2-utils.postrm
+++ b/debian/shibboleth-sp2-utils.postrm
@@ -2,8 +2,13 @@
 
 set -e
 
-if [ "$1" = purge ] || [ "$1" = remove ] ; then
-    rm -rf /var/cache/shibboleth /var/run/shibboleth
+if [ "$1" = purge ]; then
+    for dir in /var/cache/shibboleth /var/log/shibboleth; do
+        if dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
+            dpkg-statoverride --remove "$dir"
+        fi
+        rm -rf "$dir"
+    done
 fi
 
 #DEBHELPER#

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list