===================================================================
RCS file: /cvs/cvsweb/cvsweb.cgi,v
retrieving revision 4.21
retrieving revision 4.22
diff -u -p -r4.21 -r4.22
--- cvsweb/cvsweb.cgi 2019/11/12 09:28:15 4.21
+++ cvsweb/cvsweb.cgi 2019/11/13 09:12:47 4.22
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id: cvsweb.cgi,v 4.21 2019/11/12 09:28:15 schwarze Exp $
+# $Id: cvsweb.cgi,v 4.22 2019/11/13 09:12:47 schwarze Exp $
# $knu: cvsweb.cgi,v 1.299 2010/11/13 16:37:18 simon
#
# cvsweb - a CGI interface to CVS trees.
@@ -144,7 +144,6 @@ sub spacedHtmlText($;$);
sub link($$);
sub revcmp($$);
sub fatal($$@);
-sub config_error($$);
sub redirect($;$);
sub safeglob($);
sub search_path($);
@@ -316,14 +315,18 @@ $maycompress = (
qw(cvsroot hideattic ignorecase sortby logsort f only_with_tag ln
hidecvsroot hidenonreadable);
-#
# Load configuration.
-#
-if (-f $config) {
- do "$config" or config_error($config, $@);
-} else {
- fatal("500 Internal Error",
- 'Configuration not found. Set the parameter $config
in cvsweb.cgi to your cvsweb.conf configuration file first.');
+{
+ $config =~ m|^/| or fatal '500 Internal Error',
+ 'Configuration file name "%s
" is not an absolute path.',
+ $config;
+ defined do $config and last;
+ $@ and fatal '500 Internal Error',
+ 'Error loading configuration file "%s
":
%s', + $config, $@; + fatal '500 Internal Error', + 'Cannot read configuration file "
%s
": %s',
+ $config, $! || 'unknown error';
}
# Try to find a readable dir where we can cd into. Some abs_path()
@@ -1542,17 +1545,6 @@ sub fatal($$@)
sprintf($format, map(htmlquote($_), @args)), "\n";
html_footer();
exit(1);
-}
-
-
-#
-# Signal a (fatal) configuration error.
-#
-sub config_error($$)
-{
- fatal('500 Internal Error',
- 'Error loading configuration file "%s
":