From f23ef1c96859f6b01a9268c8606a22ceb719cf3d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 26 Apr 2013 05:26:58 -0400 Subject: [PATCH] Fix error handling in CLI mode, use STDERR and non-empty exit code (#1489043) --- bin/decrypt.sh | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-) diff --git a/bin/decrypt.sh b/bin/decrypt.sh index 51a89e9..ff7c430 100755 --- a/bin/decrypt.sh +++ b/bin/decrypt.sh @@ -1,13 +1,15 @@ #!/usr/bin/env php <?php /* - +-----------------------------------------------------------------------+ | bin/decrypt.sh | | | - | This file is part of the RoundCube Webmail client | - | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland | - | Licensed under the GNU GPL | + | This file is part of the Roundcube Webmail client | + | Copyright (C) 2005-2009, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | | | | PURPOSE: | | Decrypt the encrypted parts of the HTTP Received: headers | @@ -15,11 +17,9 @@ +-----------------------------------------------------------------------+ | Author: Tomas Tevesz <ice@extreme.hu> | +-----------------------------------------------------------------------+ - - $Id$ */ -/*- +/** * If http_received_header_encrypt is configured, the IP address and the * host name of the added Received: header is encrypted with 3DES, to * protect information that some could consider sensitve, yet their @@ -28,8 +28,8 @@ * Such an encrypted Received: header might look like: * * Received: from DzgkvJBO5+bw+oje5JACeNIa/uSI4mRw2cy5YoPBba73eyBmjtyHnQ== - * [my0nUbjZXKtl7KVBZcsvWOxxtyVFxza4] - * with HTTP/1.1 (POST); Thu, 14 May 2009 19:17:28 +0200 + * [my0nUbjZXKtl7KVBZcsvWOxxtyVFxza4] + * with HTTP/1.1 (POST); Thu, 14 May 2009 19:17:28 +0200 * * In this example, the two encrypted components are the sender host name * (DzgkvJBO5+bw+oje5JACeNIa/uSI4mRw2cy5YoPBba73eyBmjtyHnQ==) and the IP @@ -48,16 +48,13 @@ * * If (most likely binary) junk is shown, then * - either the encryption password has, between the time the mail was sent - * and `now', changed, or + * and 'now', changed, or * - you are dealing with counterfeit header data. */ -if (php_sapi_name() != 'cli') { - die("Not on the 'shell' (php-cli).\n"); -} - define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/'); -require INSTALL_PATH . 'program/include/iniset.php'; + +require INSTALL_PATH . 'program/include/clisetup.php'; if ($argc < 2) { die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n"); -- Gitblit v1.9.1