aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-23 17:38:36 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-31 14:20:32 +0200
commita6f43d09d7e015c0612bfe5980827fc8dfc4d12e (patch)
tree51e4035ef2b226d9c949318a2183c8cea731f5b2 /travis
parentf4fc1bde03f3026b80fcb9da2cd332ce57ba54a9 (diff)
downloadforums-a6f43d09d7e015c0612bfe5980827fc8dfc4d12e.tar
forums-a6f43d09d7e015c0612bfe5980827fc8dfc4d12e.tar.gz
forums-a6f43d09d7e015c0612bfe5980827fc8dfc4d12e.tar.bz2
forums-a6f43d09d7e015c0612bfe5980827fc8dfc4d12e.tar.xz
forums-a6f43d09d7e015c0612bfe5980827fc8dfc4d12e.zip
[ticket/12693] Add a travis test that checks file permissions
PHPBB3-12693
Diffstat (limited to 'travis')
-rw-r--r--travis/check-executable-files.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/travis/check-executable-files.sh b/travis/check-executable-files.sh
new file mode 100644
index 0000000000..a5d4ded7e1
--- /dev/null
+++ b/travis/check-executable-files.sh
@@ -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 \ No newline at end of file