Skip to content

Commit 97ddf7e

Browse files
committed
[ticket/16661] Add check executable files for extensions
Also added some minor code adjustments. PHPBB3-16661
1 parent f67e2b9 commit 97ddf7e

File tree

3 files changed

+65
-7
lines changed

3 files changed

+65
-7
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
#
3+
# This file is part of the phpBB Forum Software package.
4+
#
5+
# @copyright (c) phpBB Limited <https://www.phpbb.com>
6+
# @license GNU General Public License, version 2 (GPL-2.0)
7+
#
8+
# For full copyright and license information, please see
9+
# the docs/CREDITS.txt file.
10+
#
11+
set -e
12+
13+
root="$1"
14+
extname="$2"
15+
path="${root}phpBB/ext/${extname}/"
16+
17+
# Check the permissions of the files
18+
19+
# The following variables MUST NOT contain any wildcard
20+
# Directories to skip
21+
directories_skipped="-path ${path}develop -o -path ${path}vendor"
22+
23+
# Files to skip
24+
files_skipped="-false"
25+
26+
# Files which have to be executable
27+
executable_files="-path ${path}bin/* -o -path ${path}install/phpbbcli.php"
28+
29+
incorrect_files=$( \
30+
find ${path} \
31+
'(' \
32+
'(' \
33+
${directories_skipped} \
34+
')' \
35+
-a -type d -prune -a -type f \
36+
')' -o \
37+
'(' \
38+
-type f -a \
39+
-not '(' \
40+
${files_skipped} \
41+
')' -a \
42+
'(' \
43+
'(' \
44+
'(' \
45+
${executable_files} \
46+
')' -a \
47+
-not -perm /100 \
48+
')' -o \
49+
'(' \
50+
-not '(' \
51+
${executable_files} \
52+
')' -a \
53+
-perm /111 \
54+
')' \
55+
')' \
56+
')' \
57+
)
58+
59+
if [ "${incorrect_files}" != '' ]
60+
then
61+
echo "The following files do not have proper permissions:";
62+
ls -la ${incorrect_files}
63+
exit 1;
64+
fi

.github/phpunit-sqlite3-github.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
</groups>
2828

2929
<php>
30-
<!--server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\sqlite3" /-->
31-
<!--server name="PHPBB_TEST_DBHOST" value="../phpbb_unit_tests.sqlite3" /-->
32-
<!--server name="PHPBB_TEST_DBPORT" value="" /-->
33-
<!--server name="PHPBB_TEST_DBNAME" value="" /-->
34-
<!--server name="PHPBB_TEST_DBUSER" value="" /-->
35-
<!--server name="PHPBB_TEST_DBPASSWD" value="" /-->
3630
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
3731
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" />
3832
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>

.github/prepare-extension.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ EXTNAME=$1
1717
mkdir --parents phpBB/ext/$EXTNAME
1818
cp -R ../tmp/* phpBB/ext/$EXTNAME
1919

20-
# Move the extensions .github/phpunit-*-travis.xml files in place
20+
# Move the test files for extensions in place
2121
cp -R .github/*.xml phpBB/ext/$EXTNAME/.github
2222
cp -R .github/*.sh phpBB/ext/$EXTNAME/.github

0 commit comments

Comments
 (0)