From: lpsolit%gmail.com <> Date: Wed, 21 Dec 2005 06:25:57 +0000 (+0000) Subject: Bug 287741: changing password from 'password' to 'password' should not invalidate... X-Git-Tag: bugzilla-2.22rc1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2a422ca3f0edf77f6aafd064b4e00a5883bb1b8;p=thirdparty%2Fbugzilla.git Bug 287741: changing password from 'password' to 'password' should not invalidate login cookies - Patch by Marc Schumann r=LpSolit a=justdave --- diff --git a/userprefs.cgi b/userprefs.cgi index df2255ce42..3dc68121ef 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -97,16 +97,18 @@ sub SaveAccount { $cgi->param('new_password1') || ThrowUserError("new_password_missing"); ValidatePassword($pwd1, $pwd2); - - my $cryptedpassword = bz_crypt($pwd1); - trick_taint($cryptedpassword); # Only used in a placeholder - $dbh->do(q{UPDATE profiles - SET cryptpassword = ? - WHERE userid = ?}, - undef, ($cryptedpassword, $user->id)); - - # Invalidate all logins except for the current one - Bugzilla->logout(LOGOUT_KEEP_CURRENT); + + if ($cgi->param('Bugzilla_password') ne $pwd1) { + my $cryptedpassword = bz_crypt($pwd1); + trick_taint($cryptedpassword); # Only used in a placeholder + $dbh->do(q{UPDATE profiles + SET cryptpassword = ? + WHERE userid = ?}, + undef, ($cryptedpassword, $user->id)); + + # Invalidate all logins except for the current one + Bugzilla->logout(LOGOUT_KEEP_CURRENT); + } } }