From 3b0560db062187054b254a441935ab8d34287e7f Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 23 Sep 2006 06:01:00 +0000 Subject: Bug 351243: Public webdot server changed its IP address Patch By Max Kanat-Alexander r=colin, a=justdave --- Bugzilla/Constants.pm | 2 +- Bugzilla/Install/Filesystem.pm | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 93d8d8d2c..4ce2cbc09 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -380,7 +380,7 @@ sub bz_locations { # change showdependencygraph.cgi to set image_url to the correct # location. # The script should really generate these graphs directly... - 'webdotdir' => "$libpath/$datadir/webdot", + 'webdotdir' => "$datadir/webdot", 'extensionsdir' => "$libpath/extensions", }; } diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index cb2800dd7..c9c090bb0 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -257,7 +257,7 @@ EOT # if research.att.com ever changes their IP, or if you use a different # webdot server, you'll need to edit this - Allow from 192.20.225.10 + Allow from 192.20.225.0/24 Deny from all @@ -385,6 +385,22 @@ sub create_htaccess { print $htaccess $old_data; $htaccess->close; } + + + my $webdot_dir = bz_locations()->{'webdotdir'}; + # The public webdot IP address changed. + my $webdot = new IO::File("$webdot_dir/.htaccess", 'r') + || die "$webdot_dir/.htaccess: $!"; + my $webdot_data; + { local $/; $webdot_data = <$webdot>; } + $webdot->close; + if ($webdot_data =~ /192\.20\.225\.10/) { + print "Repairing $webdot_dir/.htaccess...\n"; + $webdot_data =~ s/192\.20\.225\.10/192.20.225.0\/24/g; + $webdot = new IO::File("$webdot_dir/.htaccess", 'w') || die $!; + print $webdot $webdot_data; + $webdot->close; + } } # A helper for the above functions. -- cgit v1.2.3-24-g4f1b