diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-01-26 08:54:46 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-26 08:54:46 -0800 |
| commit | b700f119d183423916be7b8b0a2d48970cdf20e5 (patch) | |
| tree | 96be08075da5f19a6f8106c9a1edd25158bb1fea /gitweb/gitweb.perl | |
| parent | Merge branch 'ps/worktree-refdb-initialization' (diff) | |
| parent | gitweb: die when a configuration file cannot be read (diff) | |
| download | git-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-x | gitweb/gitweb.perl | 4 |
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; } |
