Unverified Commit ac3c7059 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Account: do not disclose denylist filename on open error

parent ed0054fa
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -88,8 +88,7 @@ sub register {
	if ( my $registration_denylist
		= $self->app->config->{registration}->{denylist} )
	{
		open( my $fh, "<", $registration_denylist )
		  or die("cannot open($registration_denylist)");
		if ( open( my $fh, "<", $registration_denylist ) ) {
			while ( my $line = <$fh> ) {
				chomp $line;
				if ( $ip eq $line ) {
@@ -100,6 +99,11 @@ sub register {
			}
			close($fh);
		}
		else {
			$self->log->error("Cannot open($registration_denylist): $!");
			die("Cannot verify registration: $!");
		}
	}

	if ( my $error = $self->users->is_name_invalid( name => $user ) ) {
		$self->render( 'register', invalid => $error );