X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=web%2FWEB-INF%2Fperms.sh-dist;fp=web%2FWEB-INF%2Fperms.sh-dist;h=3c312aff922220331cc6ee2eee23f869ee83c521;hb=c9ac8fa71b679f8d967aac901bbef945c13b94c9;hp=0000000000000000000000000000000000000000;hpb=d63595f89aaa4b6a524dc0b4af9e0eef888f4c6b;p=mir.git diff --git a/web/WEB-INF/perms.sh-dist b/web/WEB-INF/perms.sh-dist new file mode 100644 index 00000000..3c312aff --- /dev/null +++ b/web/WEB-INF/perms.sh-dist @@ -0,0 +1,48 @@ +#!/bin/sh + +# Where the installed system resides +INSTDIR=`dirname $0` + +# The group all files belong to +GROUP=www-data + + +# No config required after this point. Hopefully. +################################################################## + +# Needed to correct permissions + +function chm() +{ + # Parameters. $1 permissions + # $2 directory or file + # $3 mode: [d|f] (dir or file) + + LIST=$(find $2 -type $3) + if [ "$LIST" != "" ]; then + echo "$LIST" + chmod $1 $LIST + fi +} + +function grant() +{ + # Parameters: $1: permissions for dirs + # $2: permissions for files + # $3: directory or file + + chmod $1 $3 + UMASK=$(umask) + umask 044 +# chmod $1 $(find $3 -type d) +# chmod $2 $(find $3 -type f) + chm $1 $3 d + chm $2 $3 f + umask $UMASK +} + +chgrp $GROUP $INSTDIR -R #> /dev/null 2>&1 +grant 775 664 $INSTDIR > /dev/null 2>&1 +grant 750 640 etc/config.properties + +echo "Permissions set."