aboutsummaryrefslogtreecommitdiffstats
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-01-26 08:54:46 -0800
committerJunio C Hamano <gitster@pobox.com>2024-01-26 08:54:46 -0800
commitb700f119d183423916be7b8b0a2d48970cdf20e5 (patch)
tree96be08075da5f19a6f8106c9a1edd25158bb1fea /gitweb/gitweb.perl
parentMerge branch 'ps/worktree-refdb-initialization' (diff)
parentgitweb: die when a configuration file cannot be read (diff)
downloadgit-b700f119d183423916be7b8b0a2d48970cdf20e5.tar.gz
git-b700f119d183423916be7b8b0a2d48970cdf20e5.zip
Merge branch 'mj/gitweb-unreadable-config-error'
When given an existing but unreadable file as a configuration file, gitweb behaved as if the file did not exist at all, but now it errors out. This is a change that may break backward compatibility. * mj/gitweb-unreadable-config-error: gitweb: die when a configuration file cannot be read
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fc6d5dd522..ccd14e0e30 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -728,9 +728,11 @@ our $per_request_config = 1;
sub read_config_file {
my $filename = shift;
return unless defined $filename;
- # die if there are errors parsing config file
if (-e $filename) {
do $filename;
+ # die if there is a problem accessing the file
+ die $! if $!;
+ # die if there are errors parsing config file
die $@ if $@;
return 1;
}