Skip to content

Commit

Permalink
Item12180: Provide after-the-fact evidence of corruption when a plugi…
Browse files Browse the repository at this point in the history
…n or other required/used module loads Foswik.pm, which is absolutely verboten in configure.

git-svn-id: http://svn.foswiki.org/trunk@16424 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Jan 20, 2013
1 parent 2bb5fbb commit 4923dfc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/bin/configure
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ our $VERSION = '3.0_001';

sub log;

END {
if ( exists $INC{'Foswiki.pm'} ) {
my $message =
"Foswiki ERROR: Some module loaded Foswiki.pm into configure. This is not permitted, and will cause unpredictable results, including corruption of the Foswiki configuration. This is probably caused by a pluggable module, such as a checker, pluggable, or Foswiki Engine code that was inappropriately used (use, require) in configure. This must be tracked-down and removed.\n";
print STDERR $message;
die $message;
}
}

# This is absolutely essential for error reporting. We load it using
# an eval so we can report the problem.
eval "use CGI::Carp qw(fatalsToBrowser)";
Expand Down

0 comments on commit 4923dfc

Please sign in to comment.