From patchwork Tue Feb 13 09:19:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Held X-Patchwork-Id: 1659 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 02FD461922 for ; Mon, 12 Feb 2018 23:20:28 +0100 (CET) X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id D9E181140A3F; Mon, 12 Feb 2018 22:20:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org D9E181140A3F Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=development-bounces@lists.ipfire.org X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id EC4031140A3E for ; Mon, 12 Feb 2018 22:19:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org EC4031140A3E Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=berny156@gmx.de Received: from quad.berny.local ([46.244.228.114]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lkx9B-1eDgFw3MPt-00ajfz for ; Mon, 12 Feb 2018 23:19:37 +0100 From: Bernhard Held To: development@lists.ipfire.org Subject: [PATCH v2 3/4] proxy.cgi: strip newline from subnet parameter Date: Mon, 12 Feb 2018 23:19:31 +0100 Message-Id: <20180212221932.29122-4-berny156@gmx.de> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180212221932.29122-1-berny156@gmx.de> References: <20180212221932.29122-1-berny156@gmx.de> X-Provags-ID: V03:K0:+M2wSmrqLdasQ/dNAJ94qg+Vieum4AEIx4SnQLU6VXAjZuYH5Am +/MKhJQMXOfE7UykpW7Wg56AV7SPYqudghKwy3ymg0CkMkf0NnTtbSDxRHdcjoOOKBzgYDD 4ZeuborOChaIOnNEzNbN/R8MoJ2J3L4TYes+NRpPih94x0E9wdEFIzTKw5ko4Hs+Kw58nlY W9ln2cdsY/U8D296a7aoQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:EuXeltn1iSw=:zkNnli1eVJmWatWjzwkGET sMnSwZflptyuIE6kdSmH9GNH4uD0lWNhaNyuaZHRjvGMkQYAwJdTlprL0ugejPhraHcfY/fyL gbqoWZK9FbBw9milhFG3e9tSxL82rwDmYgy0bQ+vvXK32zszsBbemFnVQNfeat2aSDXirJ5Xi MHANTnQbR+aQBQ//VrxkyOaFniLsRP1+FyVynxgD3MvjCGIGwWpBDUOj11hEjfozDGTqUXkp2 UTyTAPY6+F2J6qR9VQZFFLtSPOlx6Zz5m+b5yHITtlycqavXC6NbGLXNhU4OK3x2/jX4Eu3G6 vuChQIJfrkH4oZJZzLNR5MbDIZxqTG1wJsXs1SFpm9udgDJagfR59gbwA4im5OA8aKzNdN0Uj A+o8vl4lV1/pfoRfOX+s731/14TgITKfCYaOP+rHbxjun8LpdaRQKrW5eQfuz5vgtXAN4oZkn N3AxMN0maZaXCp5CUsm7dcAah42uKPVAVHdnc4Ap1ea/lBxpR1YB/qN3poxsy4dbj1CbdVCYH uDJR6H/S7geyUgf503vbc8zTfAnat71QcAMmZa/L5i1u+EtRomxDcfxCoTnmxpDcoh2984My2 06tuTTOrmrrmaKC/YgFxFlcS8uWCalijDO1CtjFRnX8SxP5++51OW6dP7VxyQoBsH0G+3LUJl nq7pDhJhB6G3m9izMBwxloV/8bwki2tm0RVtEIZAFmfd5z1DLtXwHnsC4DuMT7QSlKz9vUwMk jrTVZ+o6/iSdbOa2S1NngRpuuqOz0bA6eO2SB3Dw3/rtr71UjZxcIl0QQMX7TUu21Rdkxiegh 018/5P3qwx/+p5Nlmw3mSKtZ//feg== X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" $temp[1] might end with a newline; this is unavoidable when specifying serveral subnets. Thus, 'chomp $temp[1];' has to be moved before the comparisons with the green and blue subnets. Otherwise the comparison might always be wrong due to the newline. --- html/cgi-bin/proxy.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index 6aa14e15a..ea3b41126 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -3064,12 +3064,12 @@ END foreach (@templist) { @temp = split(/\//); + chomp $temp[1]; if ( ($temp[0] ne $netsettings{'GREEN_NETADDRESS'}) && ($temp[1] ne $netsettings{'GREEN_NETMASK'}) && ($temp[0] ne $netsettings{'BLUE_NETADDRESS'}) && ($temp[1] ne $netsettings{'BLUE_NETMASK'}) ) { - chomp $temp[1]; print FILE " ||\n (isInNet(myIpAddress(), \"$temp[0]\", \"$temp[1]\"))"; } }