Message ID | 190f0a6c-c334-24d3-28ca-7f732aa0fc85@ipfire.org |
---|---|
State | Accepted |
Commit | 5fe798b52f25a2895dced9e69dafe99491e61b39 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> 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 4C7HwT6BkVz3x0j for <patchwork@web04.haj.ipfire.org>; Fri, 9 Oct 2020 19:20: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) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4C7HwS6N22zkR; Fri, 9 Oct 2020 19:20:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4C7HwS5cg9z2yRn; Fri, 9 Oct 2020 19:20:40 +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 4C7HwR4kL3z2xrJ for <development@lists.ipfire.org>; Fri, 9 Oct 2020 19:20:39 +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)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4C7HwP41nJzkR for <development@lists.ipfire.org>; Fri, 9 Oct 2020 19:20:37 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1602271238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06ZpeXU2Zf0ipUYBWYRJJKFLYqVnq13nVt11UjsUv64=; b=9zziqoK/XFgHgSnUMYwsf3M2JWezhz82+UuJcRrjTs/iTIEVSETsQGDVKIAxLEHTd2KzRs YUBUlk9DGjQ4DpDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1602271238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06ZpeXU2Zf0ipUYBWYRJJKFLYqVnq13nVt11UjsUv64=; b=SDxkcfEDKwuOVqHFLIm7wF7t5yYDyny0r5iB9tI2iHGNJkJHj+SxqorGvgvACzuU0I1jpi THz/+ditqa6VxzZsU/HLSqQCXXkFKHpbta3kK/ae8lsfHqQMZlmC2yX0zEhiDOm2YMzoGI Dvbv14+kYnU0HPGhhye0fmRylEXXry4/jhUPly5AHDmKp2prMPmNsMY4tuxihDTaafJ4Wp VCedr3Dc1DSn7aGKiL6xJ4URHEXMXo46sh7Nm5k7KW8uS1EfEj/ZmSj7BA/9ZsTHWqn3Sw I4ULA9kugIywbPrBNFsgZjWofsVllN/OR0ez8G3OHWvAYIhb8oMBYhfoKlbUNw== To: development@lists.ipfire.org From: =?utf-8?q?Peter_M=C3=BCller?= <peter.mueller@ipfire.org> Subject: [PATCH v2] tor.cgi: fix calling Perl location module functions Message-ID: <190f0a6c-c334-24d3-28ca-7f732aa0fc85@ipfire.org> Date: Fri, 9 Oct 2020 19:20:32 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=pmueller smtp.mailfrom=peter.mueller@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
[v2] tor.cgi: fix calling Perl location module functions
|
|
Commit Message
Peter Müller
Oct. 9, 2020, 7:20 p.m. UTC
The second version of this patch avoids re-defining $db_handle.
Fixes: #12492
Cc: Stefan Schantl <stefan.schantl@ipfire.org
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
html/cgi-bin/tor.cgi | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
Could anyone please test this and confirm that it works? > On 9 Oct 2020, at 20:20, Peter Müller <peter.mueller@ipfire.org> wrote: > > The second version of this patch avoids re-defining $db_handle. > > Fixes: #12492 > > Cc: Stefan Schantl <stefan.schantl@ipfire.org > Signed-off-by: Peter Müller <peter.mueller@ipfire.org> > --- > html/cgi-bin/tor.cgi | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi > index 28dec6cf0..7447bd791 100644 > --- a/html/cgi-bin/tor.cgi > +++ b/html/cgi-bin/tor.cgi > @@ -322,14 +322,13 @@ END > <select name='TOR_EXIT_COUNTRY'> > <option value=''>- $Lang::tr{'tor exit country any'} -</option> > END > - > - my @country_codes = &Location::database_countries(); > + my @country_codes = &Location::database_countries($db_handle); > foreach my $country_code (@country_codes) { > # Convert country code into upper case format. > $country_code = uc($country_code); > > # Get country name. > - my $country_name = &Location::Functions::get_country_name($country_code); > + my $country_name = &Location::Functions::get_full_country_name($country_code); > > print "<option value='$country_code'"; > > -- > 2.26.2
Hi Michael, I installed tor and confirmed that the last part of the tor page was missing. I then patched the tor.cgi file with Peter's patch and then the whole tor page was now being shown. I was able to enable tor and save and tor was then shown as running. I can confirm that the patch works. Regards, Adolf. On 10/10/2020 13:46, Michael Tremer wrote: > Could anyone please test this and confirm that it works? > >> On 9 Oct 2020, at 20:20, Peter Müller <peter.mueller@ipfire.org> wrote: >> >> The second version of this patch avoids re-defining $db_handle. >> >> Fixes: #12492 >> >> Cc: Stefan Schantl <stefan.schantl@ipfire.org >> Signed-off-by: Peter Müller <peter.mueller@ipfire.org> >> --- >> html/cgi-bin/tor.cgi | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi >> index 28dec6cf0..7447bd791 100644 >> --- a/html/cgi-bin/tor.cgi >> +++ b/html/cgi-bin/tor.cgi >> @@ -322,14 +322,13 @@ END >> <select name='TOR_EXIT_COUNTRY'> >> <option value=''>- $Lang::tr{'tor exit country any'} -</option> >> END >> - >> - my @country_codes = &Location::database_countries(); >> + my @country_codes = &Location::database_countries($db_handle); >> foreach my $country_code (@country_codes) { >> # Convert country code into upper case format. >> $country_code = uc($country_code); >> >> # Get country name. >> - my $country_name = &Location::Functions::get_country_name($country_code); >> + my $country_name = &Location::Functions::get_full_country_name($country_code); >> >> print "<option value='$country_code'"; >> >> -- >> 2.26.2 >
Hello Peter, very good found and thanks for the patch. Acked-By: Stefan Schantl <stefan.schantl@ipfire.org> > The second version of this patch avoids re-defining $db_handle. > > Fixes: #12492 > > Cc: Stefan Schantl <stefan.schantl@ipfire.org > Signed-off-by: Peter Müller <peter.mueller@ipfire.org> > --- > html/cgi-bin/tor.cgi | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi > index 28dec6cf0..7447bd791 100644 > --- a/html/cgi-bin/tor.cgi > +++ b/html/cgi-bin/tor.cgi > @@ -322,14 +322,13 @@ END > <select > name='TOR_EXIT_COUNTRY'> > <option value=''>- > $Lang::tr{'tor exit country any'} -</option> > END > - > - my @country_codes = &Location::database_countries(); > + my @country_codes = > &Location::database_countries($db_handle); > foreach my $country_code (@country_codes) { > # Convert country code into upper case format. > $country_code = uc($country_code); > > # Get country name. > - my $country_name = > &Location::Functions::get_country_name($country_code); > + my $country_name = > &Location::Functions::get_full_country_name($country_code); > > print "<option value='$country_code'"; >
Hi Stefan, Did you see that the same problem exists for the firewall rule pages? -Michael > On 11 Oct 2020, at 18:39, Stefan Schantl <stefan.schantl@ipfire.org> wrote: > > Hello Peter, > > very good found and thanks for the patch. > > Acked-By: Stefan Schantl <stefan.schantl@ipfire.org> > >> The second version of this patch avoids re-defining $db_handle. >> >> Fixes: #12492 >> >> Cc: Stefan Schantl <stefan.schantl@ipfire.org >> Signed-off-by: Peter Müller <peter.mueller@ipfire.org> >> --- >> html/cgi-bin/tor.cgi | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi >> index 28dec6cf0..7447bd791 100644 >> --- a/html/cgi-bin/tor.cgi >> +++ b/html/cgi-bin/tor.cgi >> @@ -322,14 +322,13 @@ END >> <select >> name='TOR_EXIT_COUNTRY'> >> <option value=''>- >> $Lang::tr{'tor exit country any'} -</option> >> END >> - >> - my @country_codes = &Location::database_countries(); >> + my @country_codes = >> &Location::database_countries($db_handle); >> foreach my $country_code (@country_codes) { >> # Convert country code into upper case format. >> $country_code = uc($country_code); >> >> # Get country name. >> - my $country_name = >> &Location::Functions::get_country_name($country_code); >> + my $country_name = >> &Location::Functions::get_full_country_name($country_code); >> >> print "<option value='$country_code'"; >> >
diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 28dec6cf0..7447bd791 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -322,14 +322,13 @@ END <select name='TOR_EXIT_COUNTRY'> <option value=''>- $Lang::tr{'tor exit country any'} -</option> END - - my @country_codes = &Location::database_countries(); + my @country_codes = &Location::database_countries($db_handle); foreach my $country_code (@country_codes) { # Convert country code into upper case format. $country_code = uc($country_code); # Get country name. - my $country_name = &Location::Functions::get_country_name($country_code); + my $country_name = &Location::Functions::get_full_country_name($country_code); print "<option value='$country_code'";