close $gpgv;
}
-my %info; # package being processed; a global so fatal and mail can use it
+my %info; # package being processed; a global so mail can use it
=head1 INTERNALS
}
# make sure our directories all exist, or it's hopeless.
-# Use die instead of fatal - this error should "never" happen.
+# Use ftp_abort here - this error should "never" happen.
{
our $Inbox_dir; our $Scratch_dir; our $Public_dir; our $Stage_dir;
for my $dir ($package_config_base, $Inbox_dir, $Scratch_dir,
$msg);
}
-# Send email with TAINTED_MSG to the ftp maintainers, as well as any
-# address specified for the package. Rename the bad files with a
-# leading . so we don't try to process them again. Finally, write the
-# same MSG to stderr and exit badly.
-#
-# It's ok that we quit here without processing every file, because we'll
-# be invoked again from cron in a few minutes and will look further then.
-# The bad . files will eventually get cleaned up via a separate script.
-#
-sub fatal {
- my $tainted_msg = shift;
- my $send_to_user = shift;
- # If we fail before we have sent a copy of the directive file contents to
- # the maintainer (when running in DEBUG mode), that copy is passed along,
- # and we can send it from here.
- my $directive_file_contents = shift;
- my $exit_code = shift;
-
- ftp_syslog('err', "$tainted_msg");
-
- # Don't let them do perl or shell quoting tricks, but show everything
- # that's definitely harmless.
- #
- $tainted_msg =~ s=[^-.:,/@\w\s]==g;
- $tainted_msg =~ m=^([-.:,/@\w\s]+)$=;
- my $msg = $1;
-
- our $Phase;
- die {Phase => $Phase,
- message => $msg,
- send_to_user => $send_to_user};
-}
-
\f
#
# - Directive reader and parsing helpers
if $directive_text && DEBUG;
}
- # If a send_to_user key is set, then this came from a call to fatal().
- if (defined $E->{send_to_user}) { # scaffolding for now
- mail($E->{message},$E->{send_to_user});
- } elsif ($E->type_p('directive_syntax')) {
+ if ($E->type_p('directive_syntax')) {
mail(join("\n",$E->summary,'',$E->trace_msg),1);
} elsif ($E->type_p('package_configuration')) {
mail($E->summary,0);