From patchwork Tue Nov 12 20:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Feddersen X-Patchwork-Id: 2594 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 47CJwd2Vndz43Tf for ; Tue, 12 Nov 2019 20:18:41 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 47CJwc08bLz2KP; Tue, 12 Nov 2019 20:18:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 47CJwb68tLz2yTX; Tue, 12 Nov 2019 20:18:39 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 47CJwZ3gXfz2xw0 for ; Tue, 12 Nov 2019 20:18:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 47CJwY74Svz2KP; Tue, 12 Nov 2019 20:18:37 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1573589918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=nvjNa72vwYqv99ms15RZIuHvEUmZSoaEjlLRKgF5Cr0=; b=W7FQTsOVEr28nWIGJmSftsU2urlaXqfzk18TA+XCMkaUQkqNt2QO4mKvnc9oj6cPy83SH4 k1Q6KPNZZfZ086Bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1573589918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=nvjNa72vwYqv99ms15RZIuHvEUmZSoaEjlLRKgF5Cr0=; b=N+9VYbFHxSXOrDpXKwKr6//AuzGohPE9odJ4WT9ZC3g8Q0r+ZoiukfiZBUSG1k00+Rc7As xdPHFLltWYJ/9UPTeS0tdbkqbL0SHM9hznnRZyLo7+1Fj6xrD4bu5Bepv271xA8oSjH15G B45VyJTcOQv9BmAEVTHyX1dQNtw2oowe3/UBqyf0q1S/h0B4LdjnRybRzJB6hAlBsDAK61 ZyWdQ4wLurqA/qau+3aWIiYnbaOR8E3fJR9jBzm8gGHeQkitqO04FE0K7QcCcVz47TZYLA 58MlcQuealq9c+apX6r55nJI51Wp6i0rZ2LQ+hwLXtMTVV84YC68V9zjyAzyjg== From: Stephan Feddersen To: development@lists.ipfire.org Subject: [PATCH] wio-1.3.1-1: bugfixing arp client import Date: Tue, 12 Nov 2019 21:18:28 +0100 Message-Id: <20191112201828.5079-1-sfeddersen@ipfire.org> Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=sfeddersen smtp.mailfrom=sfeddersen@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephan Feddersen Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- lfs/wio | 6 ++--- src/wio/wio.cgi | 61 ++++++++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/lfs/wio b/lfs/wio index 58ab16620..c82e9ed12 100644 --- a/lfs/wio +++ b/lfs/wio @@ -1,6 +1,6 @@ ############################################################################### # IPFire.org - An Open Source Firewall Solution # -# Copyright (C) 2007-2018 IPFire Team # +# Copyright (C) 2007-2019 IPFire Team # ############################################################################### ############################################################################### @@ -9,13 +9,13 @@ include Config -VER = 1.3.2 +VER = 1.3.3 THISAPP = wio-$(VER) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = wio -PAK_VER = 6 +PAK_VER = 1 ############################################################################### # Top-level Rules diff --git a/src/wio/wio.cgi b/src/wio/wio.cgi index 1645aa54e..1c380b1a5 100644 --- a/src/wio/wio.cgi +++ b/src/wio/wio.cgi @@ -3,7 +3,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2017-2018 Stephan Feddersen # +# Copyright (C) 2017-2019 Stephan Feddersen # # All Rights Reserved. # # # # This program is free software: you can redistribute it and/or modify # @@ -21,14 +21,14 @@ # # ############################################################################### # -# Version: 2018/02/27 16:54:23 +# Version: 2019/11/08 14:35:23 # # This wio.cgi is based on the Code from the IPCop WIO Addon # and is extremly adapted to work with IPFire. # # Autor: Stephan Feddersen # Co-Autor: Alexander Marx -# Co-Autor: Frank Mainz +# Co-Autor: Frank Mainz (for some Code for the IPCop WIO Addon) # use strict; @@ -215,7 +215,7 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_save'}.'2' ) { unless ( `ps -A | grep wio.pl` ) { while ( $count < $wiosettings{'COUNT'} ) { if ( defined($wiosettings{"USE$count"}) && $wiosettings{"USE$count"} eq 'on' ) { - $wiosettings{'CLIENTID'} = $wiosettings{'CLIENTID$count'}; + $wiosettings{'CLIENTID'} = $wiosettings{"CLIENTID$count"}; $wiosettings{'TIMESTAMP'} = $wiosettings{"TIMESTAMP$count"}; $wiosettings{'IPADR'} = $wiosettings{"IPADR$count"}; $wiosettings{'HOST'} = $wiosettings{"HOST$count"}; @@ -226,6 +226,7 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_save'}.'2' ) { $wiosettings{'SENDEMAILOFF'} = $wiosettings{"SENDEMAILOFF$count"}; $wiosettings{'PINGMETHODE'} = $wiosettings{"PINGMETHODE$count"}; $wiosettings{'ONLINE'} = $wiosettings{"ONLINE$count"}; + $wiosettings{'WEBINTERFACE'} = $wiosettings{"WEBINTERFACE$count"}; &validSave(); @@ -281,39 +282,54 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_client_add'} ) { ## show / hide arptable if ( $wiosettings{'WIOGUISHOWARPTABLE'} eq 'arptable' ) { - if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { - $wiosettings{'WIOGUISHOWARPTABLE'} = 'off'; - $arpbuttontext = "$Lang::tr{'wio_show_table_on'}"; + unless ( `ps -A | grep wio.pl` ) { + if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { + $wiosettings{'WIOGUISHOWARPTABLE'} = 'off'; + $arpbuttontext = "$Lang::tr{'wio_show_table_on'}"; + } + else { + $wiosettings{'WIOGUISHOWARPTABLE'} = 'on'; + $arpbuttontext = "$Lang::tr{'wio_show_table_off'}"; + } } else { - $wiosettings{'WIOGUISHOWARPTABLE'} = 'on'; - $arpbuttontext = "$Lang::tr{'wio_show_table_off'}"; + $infomessage = "$Lang::tr{'wio_error_function'}"; } } ## show / hide clientimporttable if ( $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} eq 'clientimport' ) { - if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { - $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'off'; - $clientimportbuttontext = "$Lang::tr{'wio_show_table_on'}"; + unless ( `ps -A | grep wio.pl` ) { + if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { + $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'off'; + $clientimportbuttontext = "$Lang::tr{'wio_show_table_on'}"; + } + else { + $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'on'; + $clientimportbuttontext = "$Lang::tr{'wio_show_table_off'}"; + } } else { - $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'on'; - $clientimportbuttontext = "$Lang::tr{'wio_show_table_off'}"; + $infomessage = "$Lang::tr{'wio_error_function'}"; } } ## show / hide networksearchtable if ( $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} eq 'networksearch' ) { - if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { - $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'off'; - $networksearchbuttontext = "$Lang::tr{'wio_show_table_on'}"; + unless ( `ps -A | grep wio.pl` ) { + if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) { + $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'off'; + $networksearchbuttontext = "$Lang::tr{'wio_show_table_on'}"; + } + else { + $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'on'; + $networksearchbuttontext = "$Lang::tr{'wio_show_table_off'}"; + } } else { - $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'on'; - $networksearchbuttontext = "$Lang::tr{'wio_show_table_off'}"; + $infomessage = "$Lang::tr{'wio_error_function'}"; } } @@ -388,6 +404,8 @@ if ( defined($edc) || defined($edd) || defined($wmon) || defined($wmoff) || defi if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_refresh'} || $wiosettings{'ACTION'} eq $Lang::tr{'wio_sc_refresh'} ) { +unless ( `ps -A | grep wio.pl` ) { + if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_sc_refresh'} ) { open(FILE, "> $onoffip"); print FILE @current[$wiosettings{'ID'}]; @@ -396,8 +414,6 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_refresh'} || $wiosettings{'ACTION' undef($wiosettings{'ID'}); } -unless ( `ps -A | grep wio.pl` ) { - &Header::showhttpheaders(); &Header::openpage($Lang::tr{'wio'}, 1, $refreshbox); &Header::openbigbox('100%', 'left', ''); @@ -417,7 +433,7 @@ print" while ( system("/usr/local/bin/wiohelper", "&") ) {} -exit 0; +exit 0; } else { $infomessage = "$Lang::tr{'wio_already_running'}"; @@ -662,7 +678,6 @@ foreach (@hosts) { $wiosettings{'HOST$count'} = gethostbyaddr(inet_aton($line[1]), AF_INET); if ($wiosettings{'HOST$count'} eq '') { $wiosettings{'HOST$count'} = $line[1]; } $wiosettings{'REMARK$count'} = ''; - $wiosettings{'WEBINTERFACE$count'} = ''; } else { $wiosettings{'HOST$count'} = $line[7];