Forbid non-CLI access to command-line scripts
This commit is contained in:
parent
3bd8b81154
commit
06632536f3
6 changed files with 29 additions and 0 deletions
|
@ -51,6 +51,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Util\ExAuth;
|
use Friendica\Util\ExAuth;
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@
|
||||||
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
|
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if (($_SERVER["argc"] > 1) && isset($_SERVER["argv"][1])) {
|
if (($_SERVER["argc"] > 1) && isset($_SERVER["argv"][1])) {
|
||||||
echo $_SERVER["argv"][1];
|
echo $_SERVER["argv"][1];
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
|
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
$timeout = 60;
|
$timeout = 60;
|
||||||
switch ($argc) {
|
switch ($argc) {
|
||||||
case 4:
|
case 4:
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
* Starts the background processing
|
* Starts the background processing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (php_sapi_name() !== 'cli') {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
|
|
Loading…
Reference in a new issue