excluded symlinks in find command as they will always match
This commit is contained in:
parent
cd484d4fc3
commit
e9a511a246
1 changed files with 4 additions and 15 deletions
19
www-perms.sh
19
www-perms.sh
|
|
@ -7,24 +7,13 @@
|
||||||
# so we'll check with a whitelist.
|
# so we'll check with a whitelist.
|
||||||
# Requires bash 3.2
|
# Requires bash 3.2
|
||||||
|
|
||||||
WWWROOT=/var/www/virtsrv
|
WWWROOT=/var/www/
|
||||||
WWWUSER=www-data
|
WWWUSER=www-data
|
||||||
WHITELIST="(mpd.lugh.ch/music|\
|
WHITELIST="(mpd.lugh.ch/music|\
|
||||||
mail.lugh.ch/config/conf|\
|
foo.example.org/cache|\
|
||||||
/turba/config/conf|\
|
|
||||||
admin.lugh.ch/webalizer|\
|
|
||||||
admin.lugh.ch/munin|\
|
|
||||||
oli.lugh.ch/cache|\
|
|
||||||
/wp-content/cache|\
|
/wp-content/cache|\
|
||||||
/wp-content/w3tc/objectcache|\
|
|
||||||
/wp-content/w3tc/dbcache|\
|
|
||||||
/wp-content/w3tc/pgcache|\
|
|
||||||
/wp-content/uploads|\
|
|
||||||
/piwik/tmp|\
|
|
||||||
/piwik/config/config.ini.php|\
|
/piwik/config/config.ini.php|\
|
||||||
sitemap.xml*|\
|
sitemap.xml*
|
||||||
telperien.lugh.ch/gaestebuch/data|\
|
|
||||||
telperien.lugh.ch/gaestebuch/data/book.dat
|
|
||||||
)"
|
)"
|
||||||
listcount=0
|
listcount=0
|
||||||
whitelist_matches=0
|
whitelist_matches=0
|
||||||
|
|
@ -36,7 +25,7 @@ while IFS="" read -r matchedentry; do
|
||||||
echo -e "$matchedentry\r"
|
echo -e "$matchedentry\r"
|
||||||
listcount=$((listcount+1))
|
listcount=$((listcount+1))
|
||||||
fi
|
fi
|
||||||
done < <(find "$WWWROOT" -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
|
if [ $listcount -gt 0 ]; then
|
||||||
echo "Finished: $listcount items are writable by '$WWWUSER' ($whitelist_matches whitelisted)."
|
echo "Finished: $listcount items are writable by '$WWWUSER' ($whitelist_matches whitelisted)."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue