From 334e6cb1cbceb47fd931e1b1b3adeaee4ff0933f Mon Sep 17 00:00:00 2001 From: jon4hz Date: Tue, 10 Feb 2026 16:46:35 +0100 Subject: [PATCH] fix: simplify more checks wanted variables --- lib/perl/OVH/Bastion/allowdeny.inc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/perl/OVH/Bastion/allowdeny.inc b/lib/perl/OVH/Bastion/allowdeny.inc index f61dd2e..708fb54 100644 --- a/lib/perl/OVH/Bastion/allowdeny.inc +++ b/lib/perl/OVH/Bastion/allowdeny.inc @@ -384,16 +384,10 @@ sub is_access_way_granted { } else { # check proxy IP match - if (defined $wantedProxyIp) { - $proxyMatches = 0 - if (!defined $entry->{'proxyIp'} || $entry->{'proxyIp'} ne $wantedProxyIp); - } + next if ($entry->{'proxyIp'} ne $wantedProxyIp); # check proxy port match - if (defined $wantedProxyPort && $proxyMatches) { - $proxyMatches = 0 - if (!defined $entry->{'proxyPort'} || $entry->{'proxyPort'} ne $wantedProxyPort); - } + next if ($entry->{'proxyPort'} ne $wantedProxyPort); } } # Case 2: no proxy requested, but entry has proxy info - should not match