forked from phpbb/phpbb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ticket/12693] Add a travis test that checks file permissions
PHPBB3-12693
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/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 | ||
|
||
|
||
DB=$1 | ||
TRAVIS_PHP_VERSION=$2 | ||
path="$3" | ||
|
||
if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] | ||
then | ||
# Get the list of the executables files under a given path | ||
# The part "-name 'develop' -o -name 'vendor'" defines a set | ||
# of ignored directories. | ||
# The part "-path '*/bin/phpbbcli.php' -o -name 'composer.phar'" | ||
# defines a whitelist. | ||
|
||
executables_files=$( \ | ||
find ${path} \ | ||
'(' \ | ||
'(' \ | ||
-name 'develop' -o \ | ||
-name 'vendor' \ | ||
')' \ | ||
-a -type d -prune -a -type f \ | ||
')' \ | ||
-o '(' \ | ||
-not '(' \ | ||
-path '*/bin/phpbbcli.php' -o \ | ||
-name 'composer.phar' \ | ||
')' \ | ||
-a '(' \ | ||
-perm 755 -a \ | ||
-type f \ | ||
')' \ | ||
')' \ | ||
) | ||
|
||
if [ "$executables_files" != '' ] | ||
then | ||
echo "$executables_files MUST NOT be executable."; | ||
exit 1; | ||
fi | ||
fi |