summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2006-02-21 22:48:57 +0100
committerjocuri%softhome.net <>2006-02-21 22:48:57 +0100
commit67bd8daab845430bc67415c1762878c75cf6511c (patch)
treeb3c75fde1c0ded132a02f3fff80de38af8b314e9 /Bugzilla
parent2283885c33bc4da67962de3e2cdc5e94d67ac1ef (diff)
downloadbugzilla-67bd8daab845430bc67415c1762878c75cf6511c.tar.gz
bugzilla-67bd8daab845430bc67415c1762878c75cf6511c.tar.xz
Patch for bug 323627: Setting "loginnetmask" to 0 should disable IP checking; patch by Jesse Erlbaum <jesse@erlbaum.net>, r=vladd, a=justdave.
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Auth.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm
index ba32277b7..4ea3d5bd6 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)));