From 71699f062777186d9de525bb06bcb719c87d8fc1 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Tue, 21 Mar 2000 02:48:10 +0000 Subject: Make it so that we can (hopefully!) rebuild the shadow db without busting other people trying to use the system. --- globals.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 98a72a9a3..9a62a2336 100644 --- a/globals.pl +++ b/globals.pl @@ -79,7 +79,7 @@ sub ConnectToDatabase { my ($useshadow) = (@_); if (!defined $::db) { my $name = $db_name; - if ($useshadow && Param("shadowdb")) { + if ($useshadow && Param("shadowdb") && Param("queryagainstshadowdb")) { $name = Param("shadowdb"); $::dbwritesallowed = 0; } @@ -89,7 +89,7 @@ sub ConnectToDatabase { } sub ReconnectToShadowDatabase { - if (Param("shadowdb")) { + if (Param("shadowdb") && Param("queryagainstshadowdb")) { SendSQL("USE " . Param("shadowdb")); $::dbwritesallowed = 0; } @@ -127,7 +127,7 @@ sub SendSQL { if ($iswrite && !$::dbwritesallowed) { die "Evil code attempted to write stuff to the shadow database."; } - if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/) { + if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/ && $::dbwritesallowed) { $str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i; } SqlLog($str); -- cgit v1.2.3-24-g4f1b