From patchwork Mon Oct 2 05:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 1434 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 0166561C44 for ; Sun, 1 Oct 2017 20:43:24 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id D7F262596; Sun, 1 Oct 2017 20:43:23 +0200 (CEST) Received: from Devel.localdomain (p5DD83A95.dip0.t-ipconnect.de [93.216.58.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id E0D741625 for ; Sun, 1 Oct 2017 20:43:20 +0200 (CEST) From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] BUG11494 Date: Sun, 1 Oct 2017 20:43:16 +0200 Message-Id: <20171001184316.1862-1-matthias.fischer@ipfire.org> X-Mailer: git-send-email 2.14.2 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Apache 2.4.27 breaks 'ExtraHD'-GUI => "Internal server error": Opening 'extrahd.cgi' led to: "Response header name 'scanhd idescanhd partitionsCache-control' contains invalid characters, aborting request". Triggered by: https://forum.ipfire.org/viewtopic.php?f=27&t=19550#p111030 Discussion: https://forum.ipfire.org/viewtopic.php?f=50&t=19563&sid=575337ac1caf1df492fced01ca6243de#p111048 Solution (thanks gocart!): https://forum.ipfire.org/viewtopic.php?f=22&t=19563#p111052 => Redirect '/usr/local/bin/extrahdctrl'-output to stdout. Furthermore, I added a "workaround to suppress a warning when a variable is used only once" in 'extrahd.cgi', because after activating 'use warnings' and 'fatals to browser' I got "possible typo"-warnings in 'error_log'. Plus, fixed typo in 'extrahd.pl'. Best, Matthias Signed-off-by: Matthias Fischer --- config/extrahd/extrahd.pl | 2 +- html/cgi-bin/extrahd.cgi | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index 6593ca47d..3c6fa0280 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -77,7 +77,7 @@ if ( "$ARGV[0]" eq "mount" ) { if ( ! `/bin/mount | /bin/fgrep $ARGV[1]` ) { system("/bin/cp -f /etc/fstab $fstab"); system("/bin/fgrep -v $ARGV[1] <$fstab >/etc/fstab"); - print "Succesfully umounted $ARGV[1].\n"; + print "Successfully umounted $ARGV[1].\n"; exit(0); } else { print "Can't umount $ARGV[1].\n"; diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 5a6fbce83..da1efb2dd 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -48,8 +48,13 @@ my $partitionentry = ""; my $devicefile = "/var/ipfire/extrahd/devices"; my $scanfile = "/var/ipfire/extrahd/scan"; my $partitionsfile = "/var/ipfire/extrahd/partitions"; -system("/usr/local/bin/extrahdctrl scanhd ide"); -system("/usr/local/bin/extrahdctrl scanhd partitions"); + +#workaround to suppress a warning when a variable is used only once +my @dummy = ( ${Header::colourgreen}, ${Header::colourred} ); +undef (@dummy); + +system("/usr/local/bin/extrahdctrl scanhd ide >/dev/null"); +system("/usr/local/bin/extrahdctrl scanhd partitions >/dev/null"); &Header::showhttpheaders();