From f7472d6163bed196d243c4934f557608c76a18ee Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Fri, 10 Jan 2014 10:38:55 +0100 Subject: [PATCH] simplified configuration --- www-perms.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/www-perms.sh b/www-perms.sh index bd24f49..0fd3ced 100755 --- a/www-perms.sh +++ b/www-perms.sh @@ -1,7 +1,4 @@ #!/usr/bin/env bash -# Author: Oliver Ladner -# License: LGPL -# # Checks the webroot for files being owned by www daemon and # writable at the same time. This is only needed by some files # so we'll check with a whitelist. @@ -9,11 +6,11 @@ WWWROOT=/var/www/ WWWUSER=www-data -WHITELIST="(mpd.lugh.ch/music|\ +WHITELIST="( foo.example.org/cache|\ -/wp-content/cache|\ -/piwik/config/config.ini.php|\ -sitemap.xml* +/cache/foo|\ +blah/tmpfile.txt +sitemap.xml*| )" listcount=0 whitelist_matches=0 @@ -25,7 +22,7 @@ while IFS="" read -r matchedentry; do echo -e "$matchedentry\r" listcount=$((listcount+1)) fi -done < <(find "$WWWROOT" ! -type l -perm /u+w -user $WWWUSER -o -perm /g+w -group $WWWUSER) +done < <(find "$WWWROOT" ! -type l -perm /u+w -user $WWWUSER -o -perm /g+w -group $WWWUSER) if [ $listcount -gt 0 ]; then echo "Finished: $listcount items are writable by '$WWWUSER' ($whitelist_matches whitelisted)."