From: terry%mozilla.org <> Date: Tue, 18 Jan 2000 22:26:16 +0000 (+0000) Subject: Check for and rebuild busted password stuff. X-Git-Tag: bugzilla-2.12~457 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e908456f366483dcc915bafc7036733310ebc6e5;p=thirdparty%2Fbugzilla.git Check for and rebuild busted password stuff. --- diff --git a/sanitycheck.cgi b/sanitycheck.cgi index fe17089862..33890be787 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -80,6 +80,26 @@ if (exists $::FORM{'rebuildvotecache'}) { print "OK, now running sanity checks.
\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{Click here to rebuild the crypted passwords
\n}; + } +} + + + Status("Checking groups"); SendSQL("select bit from groups where bit != pow(2, round(log(bit) / log(2)))"); while (my $bit = FetchOneColumn()) {