From bbe2531cb00636f6da1faac1e4c264457c2d8dd7 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 28 Aug 2014 12:24:44 +0000 Subject: [PATCH] Avoid overaggressive chmod/chown on upgrade It's reasonable for someone to change one or more of these directory permissions after installation. We shouldn't touch more than we need on upgrade. Each directory needs to be owned by the freeswitch user, but past that we can leave discretion to the system administrator. --- debian/freeswitch.postinst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst index 6f024b726f..d2f3f8ac87 100644 --- a/debian/freeswitch.postinst +++ b/debian/freeswitch.postinst @@ -22,9 +22,12 @@ case "$1" in /var/log/freeswitch \ /var/run/freeswitch; do - mkdir -p $x - chown -R freeswitch:freeswitch $x - chmod -R o-rwx,g+u $x + if ! test -d $x; then + mkdir -p $x + chown freeswitch:freeswitch $x + chmod o-rwx,g+u $x + fi + chown freeswitch $x done ;; abort-upgrade|abort-remove|abort-deconfigure)