2014-06-23 17:38:36 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This file is part of the phpBB Forum Software package.
|
|
|
|
#
|
|
|
|
# @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
# @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
#
|
|
|
|
# For full copyright and license information, please see
|
|
|
|
# the docs/CREDITS.txt file.
|
|
|
|
#
|
|
|
|
set -e
|
2014-06-24 21:07:14 +02:00
|
|
|
set -x
|
2014-06-23 17:38:36 +02:00
|
|
|
DB=$1
|
|
|
|
TRAVIS_PHP_VERSION=$2
|
|
|
|
path="$3"
|
|
|
|
|
|
|
|
if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ]
|
|
|
|
then
|
2014-06-24 19:28:40 +02:00
|
|
|
# Check the permissions of the files
|
2014-06-23 17:38:36 +02:00
|
|
|
|
2014-06-24 21:07:14 +02:00
|
|
|
# The following variables MUST NOT contain any wildcard
|
2014-06-24 19:28:40 +02:00
|
|
|
# Directories to skip
|
|
|
|
directories_skipped="-path ${path}develop -o -path ${path}vendor"
|
|
|
|
|
|
|
|
# Files to skip
|
|
|
|
files_skipped="-name composer.phar"
|
|
|
|
|
|
|
|
# Files which have to be executable
|
2014-06-24 21:07:14 +02:00
|
|
|
executable_files="-path ${path}bin/phpbbcli.php"
|
2014-06-24 19:28:40 +02:00
|
|
|
|
|
|
|
incorect_files=$( \
|
2014-06-23 17:38:36 +02:00
|
|
|
find ${path} \
|
|
|
|
'(' \
|
|
|
|
'(' \
|
2014-06-24 19:28:40 +02:00
|
|
|
${directories_skipped} \
|
2014-06-23 17:38:36 +02:00
|
|
|
')' \
|
|
|
|
-a -type d -prune -a -type f \
|
2014-06-24 19:28:40 +02:00
|
|
|
')' -o \
|
|
|
|
'(' \
|
|
|
|
-type f -a \
|
2014-06-23 17:38:36 +02:00
|
|
|
-not '(' \
|
2014-06-24 19:28:40 +02:00
|
|
|
${files_skipped} \
|
|
|
|
')' -a \
|
2014-06-23 23:26:08 +02:00
|
|
|
'(' \
|
2014-06-24 19:28:40 +02:00
|
|
|
'(' \
|
|
|
|
'(' \
|
|
|
|
${executable_files} \
|
|
|
|
')' -a \
|
2014-06-24 19:46:33 +02:00
|
|
|
-not -perm +100 \
|
2014-06-24 19:28:40 +02:00
|
|
|
')' -o \
|
|
|
|
'(' \
|
|
|
|
-not '(' \
|
|
|
|
${executable_files} \
|
|
|
|
')' -a \
|
|
|
|
-perm +111 \
|
|
|
|
')' \
|
|
|
|
')' \
|
2014-06-23 17:38:36 +02:00
|
|
|
')' \
|
2014-06-24 19:28:40 +02:00
|
|
|
)
|
2014-06-23 17:38:36 +02:00
|
|
|
|
2014-06-24 19:28:40 +02:00
|
|
|
if [ "${incorect_files}" != '' ]
|
2014-06-23 17:38:36 +02:00
|
|
|
then
|
2014-06-24 19:28:40 +02:00
|
|
|
ls -la ${incorect_files}
|
|
|
|
echo "does not have the proper permissions.";
|
2014-06-23 18:45:20 +02:00
|
|
|
exit 1;
|
2014-06-23 17:38:36 +02:00
|
|
|
fi
|
2014-06-23 18:45:20 +02:00
|
|
|
fi
|