Bugzilla – Attachment 120035 Details for
Bug 28200
Net::Netmask 1.9104-2 requires constructor change for backwards compatibility
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28200: Add workaround for Net::Netmask abbreviated values
Bug-28200-Add-workaround-for-NetNetmask-abbreviate.patch (text/plain), 1.50 KB, created by
David Cook
on 2021-04-23 00:04:28 UTC
(
hide
)
Description:
Bug 28200: Add workaround for Net::Netmask abbreviated values
Filename:
MIME Type:
Creator:
David Cook
Created:
2021-04-23 00:04:28 UTC
Size:
1.50 KB
patch
obsolete
>From 54ad7bc8864e3df753659b5a6e00dfd0783fdde3 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Fri, 23 Apr 2021 00:02:57 +0000 >Subject: [PATCH] Bug 28200: Add workaround for Net::Netmask abbreviated values > >This patch adds the shortnet workaround to allow Net::Netmask to >parse abbreviated values. > >To test: >1) Apply patch >2) Run unit tests >--- > Koha/Middleware/RealIP.pm | 1 + > opac/ilsdi.pl | 1 + > 2 files changed, 2 insertions(+) > >diff --git a/Koha/Middleware/RealIP.pm b/Koha/Middleware/RealIP.pm >index fc9f280ff6..294a89a3f5 100644 >--- a/Koha/Middleware/RealIP.pm >+++ b/Koha/Middleware/RealIP.pm >@@ -109,6 +109,7 @@ sub get_trusted_proxies { > my @trusted_proxies_ip = split( / /, $proxies_conf ); > my @trusted_proxies = (); > foreach my $ip (@trusted_proxies_ip){ >+ local $Net::Netmask::SHORTNET_DEFAULT = 1; > my $mask = Net::Netmask->new2($ip); > if ($mask){ > push(@trusted_proxies,$mask); >diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl >index 1b785211ce..c4bd11ba1b 100755 >--- a/opac/ilsdi.pl >+++ b/opac/ilsdi.pl >@@ -168,6 +168,7 @@ my @AuthorizedIPs = split( /,/, C4::Context->preference('ILS-DI:AuthorizedIPs') > if (@AuthorizedIPs) { # If no filter set, allow access to everybody > my $authorized = 0; > foreach my $ip (@AuthorizedIPs) { >+ local $Net::Netmask::SHORTNET_DEFAULT = 1; > my $netmask = Net::Netmask->new2($ip); > if ( $netmask && $netmask->match( $ENV{REMOTE_ADDR} ) ) { > $authorized = 1; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28200
:
120035
|
120350
|
120818
|
120851
|
120911
|
121024