summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-01-18 23:26:16 +0100
committerterry%mozilla.org <>2000-01-18 23:26:16 +0100
commite908456f366483dcc915bafc7036733310ebc6e5 (patch)
tree736c66fe099c39e0d513dde40c54357ae337273f /sanitycheck.cgi
parent53e6b664ebd6ffbaa5240de62ca3abc9b019d9e8 (diff)
downloadbugzilla-e908456f366483dcc915bafc7036733310ebc6e5.tar.gz
bugzilla-e908456f366483dcc915bafc7036733310ebc6e5.tar.xz
Check for and rebuild busted password stuff.
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi20
1 files changed, 20 insertions, 0 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index fe1708986..33890be78 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -80,6 +80,26 @@ if (exists $::FORM{'rebuildvotecache'}) {
print "OK, now running sanity checks.<P>\n";
+Status("Checking passwords");
+SendSQL("SELECT COUNT(*) FROM profiles WHERE cryptpassword != ENCRYPT(password, left(cryptpassword, 2))");
+my $count = FetchOneColumn();
+if ($count) {
+ Alert("$count entries have problems in their crypted password.");
+ if ($::FORM{'rebuildpasswords'}) {
+ Status("Rebuilding passwords");
+ SendSQL("UPDATE profiles
+ SET cryptpassword = ENCRYPT(password,
+ left(cryptpassword, 2))
+ WHERE cryptpassword != ENCRYPT(password,
+ left(cryptpassword, 2))");
+ Status("Passwords have been rebuilt.");
+ } else {
+ print qq{<a href="sanitycheck.cgi?rebuildpasswords=1">Click here to rebuild the crypted passwords</a><p>\n};
+ }
+}
+
+
+
Status("Checking groups");
SendSQL("select bit from groups where bit != pow(2, round(log(bit) / log(2)))");
while (my $bit = FetchOneColumn()) {