diff options
| author | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-01-09 21:13:00 +0000 |
|---|---|---|
| committer | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-01-09 21:13:00 +0000 |
| commit | 74b5268a9250454f651f8681b2182471e3f3e250 (patch) | |
| tree | b2622494a1197094573c6d1ef157de5982178da9 | |
| parent | 7f226423230f969ed807479539ad821f046e5634 (diff) | |
* let's not discriminate unix :) (= generalized paths)
* added checks so all scripts are only executable from CLI
git-svn-id: https://svn.roundcube.net/trunk@2229 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/bin/dumpschema.php | 6 | ||||
| -rwxr-xr-x | roundcubemail/bin/msgexport.sh | 7 | ||||
| -rwxr-xr-x | roundcubemail/bin/msgimport.sh | 7 | ||||
| -rwxr-xr-x | roundcubemail/bin/update.sh | 8 |
4 files changed, 20 insertions, 8 deletions
diff --git a/roundcubemail/bin/dumpschema.php b/roundcubemail/bin/dumpschema.php index cbadb00f6..9557c4b15 100644 --- a/roundcubemail/bin/dumpschema.php +++ b/roundcubemail/bin/dumpschema.php @@ -1,6 +1,6 @@ +#!/usr/bin/env php <?php /* - #!/usr/bin/php +-----------------------------------------------------------------------+ | bin/dumpschema.php | @@ -20,6 +20,10 @@ */ +if (php_sapi_name() != 'cli') { + die('Not on the "shell" (php-cli).'); +} + define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); require INSTALL_PATH.'program/include/iniset.php'; diff --git a/roundcubemail/bin/msgexport.sh b/roundcubemail/bin/msgexport.sh index b15da1feb..7dd56e9ea 100755 --- a/roundcubemail/bin/msgexport.sh +++ b/roundcubemail/bin/msgexport.sh @@ -1,5 +1,8 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php +if (php_sapi_name() != 'cli') { + die('Not on the "shell" (php-cli).'); +} define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); ini_set('memory_limit', -1); @@ -169,4 +172,4 @@ else vputs("IMAP login failed.\n"); } -?>
\ No newline at end of file +?> diff --git a/roundcubemail/bin/msgimport.sh b/roundcubemail/bin/msgimport.sh index fa5678cec..a5161e026 100755 --- a/roundcubemail/bin/msgimport.sh +++ b/roundcubemail/bin/msgimport.sh @@ -1,5 +1,8 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php +if (php_sapi_name() != 'cli') { + die('Not on the "shell" (php-cli).'); +} define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); ini_set('memory_limit', -1); @@ -146,4 +149,4 @@ else print "IMAP login failed.\n"; } -?>
\ No newline at end of file +?> diff --git a/roundcubemail/bin/update.sh b/roundcubemail/bin/update.sh index a9a917c8c..c93d92dec 100755 --- a/roundcubemail/bin/update.sh +++ b/roundcubemail/bin/update.sh @@ -1,6 +1,8 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php - +if (php_sapi_name() != 'cli') { + die('Not on the "shell" (php-cli).'); +} define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); require_once INSTALL_PATH . 'program/include/iniset.php'; @@ -112,4 +114,4 @@ else { echo "\n"; -?>
\ No newline at end of file +?> |
