From d1d00404414b157491cad8a77e196af5082bc059 Mon Sep 17 00:00:00 2001 From: "jocuri%softhome.net" <> Date: Tue, 21 Feb 2006 21:48:25 +0000 Subject: [PATCH] Patch for bug 323627: Setting "loginnetmask" to 0 should disable IP checking; patch by Jesse Erlbaum , r=vladd, a=justdave. --- Bugzilla/Auth.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm index ba32277b77..4ea3d5bd64 100644 --- a/Bugzilla/Auth.pm +++ b/Bugzilla/Auth.pm @@ -55,7 +55,7 @@ sub has_db { return 0; } -# Returns the network address for a given ip +# Returns the network address for a given IP sub get_netaddr { my $ipaddr = shift; @@ -68,6 +68,9 @@ sub get_netaddr { my $maskbits = Param('loginnetmask'); + # Make Bugzilla ignore the IP address if loginnetmask is set to 0 + return "0.0.0.0" if ($maskbits == 0); + $addr >>= (32-$maskbits); $addr <<= (32-$maskbits); return join(".", unpack("CCCC", pack("N", $addr))); -- 2.47.2