]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Avoid overaggressive chmod/chown on upgrade
authorTravis Cross <tc@traviscross.com>
Thu, 28 Aug 2014 12:24:44 +0000 (12:24 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 10 Sep 2014 07:32:19 +0000 (07:32 +0000)
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

index 6f024b726fe283e090be8d820d078abbdbdb6b82..d2f3f8ac8763f17fb8dbe16c46670d26be09a138 100644 (file)
@@ -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)