From f2bfa7d745a49ecc6625924a376c66ace194d8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 8 Dec 2016 11:39:32 +0100 Subject: [PATCH] Avoid running shell scripts as CGI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is really no reason for that besides misconfigured servers. This is followup for PMASA-2016-54 Signed-off-by: Michal Čihař --- scripts/create-release.sh | 6 ++++++ scripts/generate-mo | 6 ++++++ scripts/generate-sprites | 6 ++++++ scripts/lang-cleanup.sh | 6 ++++++ scripts/line-counts.sh | 7 +++++++ scripts/locales-contributors | 6 ++++++ scripts/remove-incomplete-mo | 6 ++++++ scripts/transformations_generator_main_class.sh | 8 +++++++- scripts/transformations_generator_plugin.sh | 8 +++++++- scripts/update-po | 6 ++++++ scripts/upload-release | 6 ++++++ test/install-browserstack | 6 ++++++ test/install-runkit | 6 ++++++ test/start-local-server | 6 ++++++ 14 files changed, 87 insertions(+), 2 deletions(-) diff --git a/scripts/create-release.sh b/scripts/create-release.sh index 00caf870a8a9..8d3c4b79928a 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -3,6 +3,12 @@ # vim: expandtab sw=4 ts=4 sts=4: # +# Do not run as CGI +if [ -n "$GATEWAY_INTERFACE" ] ; then + echo 'Can not invoke as CGI!' + exit 1 +fi + # More documentation about making a release is available at: # https://wiki.phpmyadmin.net/pma/Releasing diff --git a/scripts/generate-mo b/scripts/generate-mo index 9e16927d97d8..3dc88f619912 100755 --- a/scripts/generate-mo +++ b/scripts/generate-mo @@ -1,4 +1,10 @@ #!/bin/sh +# Do not run as CGI +if [ -n "$GATEWAY_INTERFACE" ] ; then + echo 'Can not invoke as CGI!' + exit 1 +fi + if [ x$1 = x--quiet ] ; then stats="" shift diff --git a/scripts/generate-sprites b/scripts/generate-sprites index 1b8ffb947764..2b80431cc7bc 100755 --- a/scripts/generate-sprites +++ b/scripts/generate-sprites @@ -1,6 +1,12 @@ #!/bin/sh # vim: expandtab sw=4 ts=4 sts=4: +# Do not run as CGI +if [ -n "$GATEWAY_INTERFACE" ] ; then + echo 'Can not invoke as CGI!' + exit 1 +fi + # Check for proper number of command line args. if [ $# -ne 1 ]; then echo "Usage: `basename $0` {path_to_pma_root_folder}" diff --git a/scripts/lang-cleanup.sh b/scripts/lang-cleanup.sh index 54dfd16f7bf2..846dffc87e51 100755 --- a/scripts/lang-cleanup.sh +++ b/scripts/lang-cleanup.sh @@ -4,6 +4,12 @@ # # Script for removing language selection from phpMyAdmin +# Do not run as CGI +if [ -n "$GATEWAY_INTERFACE" ] ; then + echo 'Can not invoke as CGI!' + exit 1 +fi + if [ $# -lt 1 ] ; then echo "Usage: lang-cleanup.sh type" echo "Type can be one of:" diff --git a/scripts/line-counts.sh b/scripts/line-counts.sh index bcf07620eaa4..c4657ca09789 100755 --- a/scripts/line-counts.sh +++ b/scripts/line-counts.sh @@ -1,4 +1,11 @@ #!/bin/bash + +# Do not run as CGI +if [ -n "$GATEWAY_INTERFACE" ] ; then + echo 'Can not invoke as CGI!' + exit 1 +fi + cat > js/line_counts.php <