shell: Add NO_LOCALSETTINGS restriction
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 7 Dec 2017 18:46:45 +0000 (10:46 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Sat, 9 Dec 2017 06:05:14 +0000 (22:05 -0800)
commit1476429857b41eaf72f12a35002f7fc1647adb3e
tree5d871f093f0c3dddbdf3f0cd3ce372043b102c4c
parent4b297d2aacd761a83a9faa238b2e87756eb266e4
shell: Add NO_LOCALSETTINGS restriction

Most secret information like database passwords are kept in LocalSettings.php,
so blacklisting that file by default would take away a lot of information an
attacker would want.

Since most commands shouldn't need to read the PHP configuration, add it to
RESTRICT_DEFAULT. People can still use:
 $cmd->restrict( Shell::RESTRICT_DEFAULT & ~Shell::NO_LOCALSETTINGS );

if they need to still access LocalSettings.php

Bug: T182484
Change-Id: I4032e2706e808e9b819e92a06eff536ccf043388
includes/shell/FirejailCommand.php
includes/shell/Shell.php
tests/phpunit/includes/shell/FirejailCommandTest.php