Skip to content

Commit

Permalink
Merge branch '5.0/vulnerable-passwords-page-users' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Apr 12, 2023
2 parents 1a274d9 + 197b9a9 commit 49b8978
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion etc/upgrade/vulnerable-passwords.in
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ if ($count == 0) {

if ($fix) {
print "Upgrading $count users...\n";
while (my $u = $users->Next) {
FetchNext( $users, 'init' );
while ( my $u = FetchNext($users) ) {
my $stored = $u->__Value("Password");
my $raw;
if (length $stored == 32) {
Expand Down Expand Up @@ -139,3 +140,19 @@ if ($fix) {
print "\n", "Run again with --fix to upgrade.\n";
exit 1;
}

use constant PAGE_SIZE => 10000;
sub FetchNext {
my ( $objs, $init ) = @_;
if ($init) {
$objs->RowsPerPage(PAGE_SIZE);
$objs->FirstPage;
return;
}

my $obj = $objs->Next;
return $obj if $obj;
$objs->RedoSearch;
$objs->FirstPage;
return $objs->Next;
}

0 comments on commit 49b8978

Please sign in to comment.