diff options
author | terry%mozilla.org <> | 2000-03-21 02:48:10 +0000 |
---|---|---|
committer | terry%mozilla.org <> | 2000-03-21 02:48:10 +0000 |
commit | 71699f062777186d9de525bb06bcb719c87d8fc1 (patch) | |
tree | 04847623af8f76e257645b61ddf059713358e377 /globals.pl | |
parent | 62ef5eab24e1cc2e3d4dbc6786a6692227e9ace9 (diff) | |
download | bugs-71699f062777186d9de525bb06bcb719c87d8fc1.tar bugs-71699f062777186d9de525bb06bcb719c87d8fc1.tar.gz bugs-71699f062777186d9de525bb06bcb719c87d8fc1.tar.bz2 bugs-71699f062777186d9de525bb06bcb719c87d8fc1.tar.xz bugs-71699f062777186d9de525bb06bcb719c87d8fc1.zip |
Make it so that we can (hopefully!) rebuild the shadow db without
busting other people trying to use the system.
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 6 |
1 files changed, 3 insertions, 3 deletions
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); |