Account: do not disclose denylist filename on open error
This commit is contained in:
parent
ed0054fa50
commit
ac3c70597d
1 changed files with 13 additions and 9 deletions
|
@ -88,17 +88,21 @@ sub register {
|
||||||
if ( my $registration_denylist
|
if ( my $registration_denylist
|
||||||
= $self->app->config->{registration}->{denylist} )
|
= $self->app->config->{registration}->{denylist} )
|
||||||
{
|
{
|
||||||
open( my $fh, "<", $registration_denylist )
|
if ( open( my $fh, "<", $registration_denylist ) ) {
|
||||||
or die("cannot open($registration_denylist)");
|
while ( my $line = <$fh> ) {
|
||||||
while ( my $line = <$fh> ) {
|
chomp $line;
|
||||||
chomp $line;
|
if ( $ip eq $line ) {
|
||||||
if ( $ip eq $line ) {
|
close($fh);
|
||||||
close($fh);
|
$self->render( 'register', invalid => "denylist" );
|
||||||
$self->render( 'register', invalid => "denylist" );
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
|
close($fh);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$self->log->error("Cannot open($registration_denylist): $!");
|
||||||
|
die("Cannot verify registration: $!");
|
||||||
}
|
}
|
||||||
close($fh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( my $error = $self->users->is_name_invalid( name => $user ) ) {
|
if ( my $error = $self->users->is_name_invalid( name => $user ) ) {
|
||||||
|
|
Loading…
Reference in a new issue