From: Travis Cross Date: Thu, 28 Aug 2014 12:24:44 +0000 (+0000) Subject: Avoid overaggressive chmod/chown on upgrade X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbe2531cb00636f6da1faac1e4c264457c2d8dd7;p=thirdparty%2Ffreeswitch.git 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. --- 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)