Skip to content

Commit

Permalink
fix owner detection for failed case-aware indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg authored and rjbs committed Mar 2, 2013
1 parent f95fe81 commit 02e8280
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/PAUSE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ sub user_is {
return $ret;
}

# must be case-insensitive
sub owner_of_module {
my($m, $dbh) = @_;
$dbh ||= dbh();
Expand All @@ -313,14 +314,11 @@ sub owner_of_module {
FROM mods where modid = ?},
primeur => qq{SELECT package,
userid
FROM primeur where package = ?},
FROM primeur where LOWER(package) = LOWER(?)},
);
for my $table (qw(mods primeur)) {
my $sth = $dbh->prepare($query{$table});
$sth->execute($m);
if ($sth->rows >= 1) {
return $sth->fetchrow_array; # ascii guaranteed
}
my $owner = $dbh->selectrow_arrayref($query{$table}, undef, $m);
return $owner->[0] if $owner;
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/PAUSE/package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ sub perm_check {
$pp->{version} = '' unless defined $pp->{version}; # accept version 0

my($p,$owner,@owner);
@owner = map { $_[1] } @$auth_ids;
@owner = map { $_->[1] } @$auth_ids;
if ($self->{FIO}{DIO}->isa_regular_perl($dist)) {
# seems ok: perl is always right
} elsif (! grep { $_ eq $userid } @owner) {
Expand Down

0 comments on commit 02e8280

Please sign in to comment.