Check against correct phpMyAdmin config permissions

This commit is contained in:
cytopia 2019-01-30 02:07:56 +01:00
parent cd20dc00b7
commit eef3582b93
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -277,7 +277,6 @@ fi
# printf "\r[OK] Submit phpMyAdmin POST login (1 round)\n" # printf "\r[OK] Submit phpMyAdmin POST login (1 round)\n"
#fi #fi
printf "[TEST] Evaluate successful phpMyAdmin login" printf "[TEST] Evaluate successful phpMyAdmin login"
# 1st Try # 1st Try
if [ "$( curl -sS -c cookie.txt -b cookie.txt localhost${URL} | tac | tac | grep -Ec "(Databases<.+SQL<.+Status<.+Users<.+Export<)|(\"User accounts\")" )" != "1" ]; then if [ "$( curl -sS -c cookie.txt -b cookie.txt localhost${URL} | tac | tac | grep -Ec "(Databases<.+SQL<.+Status<.+Users<.+Export<)|(\"User accounts\")" )" != "1" ]; then
@ -302,3 +301,19 @@ else
printf "\r[OK] Evaluate successful phpMyAdmin login (1 round)\n" printf "\r[OK] Evaluate successful phpMyAdmin login (1 round)\n"
fi fi
rm -f cookie.txt || true rm -f cookie.txt || true
###
### File permissions
###
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
DVLBOXPATH="${SCRIPTPATH}/../../"
PHPMYADMINPATH="${DVLBOXPATH}/.devilbox/www/htdocs${URL%index\.php}"
printf "[TEST] config.inc.php read-only file permissions"
if [ "$( stat --format '%a' "${PHPMYADMINPATH}config.inc.php" )" != "444" ]; then
printf "\r[FAIL] config.inc.php read-only file permissions: permission not 444\n"
exit 1
else
printf "\r[OK] config.inc.php read-only file permissions: permission 444\n"
fi