# test moving a file from inbox to scratch
{
sysopen my $test, $infile, O_WRONLY|O_CREAT|O_EXCL
- or ftp_abort("create test file in inbox: $!");
+ or ftp_abort("FATAL: create test file in inbox: $!");
close $test;
unless (rename $infile, $scratchfile and -f $scratchfile) {
unlink $infile;
- ftp_abort("FATAL: could not rename file from inbox to scratchpad: $!");
+ ftp_abort("FATAL: could not rename file from inbox to scratchpad: $!");
}
unlink $scratchfile; # test complete
}
# test moving a file from stage to public to archive
{
sysopen my $test, $stagefile, O_WRONLY|O_CREAT|O_EXCL
- or ftp_abort("create test file in staging directory: $!");
+ or ftp_abort("FATAL: create test file in staging directory: $!");
close $test;
unless (rename $stagefile, $pubfile and -f $pubfile) {
unlink $stagefile;
- ftp_abort("FATAL: could not rename file from staging to public: $!");
+ ftp_abort("FATAL: could not rename file from staging to public: $!");
}
unless (rename $pubfile, $arcfile and -f $arcfile) {
unlink $pubfile;
- ftp_abort("FATAL: could not rename file from public to archive: $!");
+ ftp_abort("FATAL: could not rename file from public to archive: $!");
}
unlink $arcfile; # test complete
}
# (CVE-2022-34903) whereby GPG could be tricked to emit arbitrary output
# on the status pipe.
pipe my $gpgv_stdin, my $gpgv_stdin_source
- or ftp_abort('failed to create pipe for gpgv stdin');
+ or ftp_abort "failed to create pipe for gpgv stdin: $!";
pipe my $gpgv_output, my $gpgv_output_sink
- or ftp_abort('failed to create pipe for gpgv output');
+ or ftp_abort "failed to create pipe for gpgv output: $!";
pipe my $gpgv_log, my $gpgv_log_sink
- or ftp_abort('failed to create pipe for gpgv log');
+ or ftp_abort "failed to create pipe for gpgv log: $!";
pipe my $gpgv_status, my $gpgv_status_sink
- or ftp_abort('failed to create pipe for gpgv status');
+ or ftp_abort "failed to create pipe for gpgv status: $!";
pipe my $gpgv_flag, my $gpgv_flag_sink
- or ftp_abort('failed to create pipe for gpgv flag');
+ or ftp_abort "failed to create pipe for gpgv flag: $!";
# ensure autoflush on writes to gpgv
{ my $outhandle = select $gpgv_stdin_source; $| = 1; select $outhandle }
if DEBUG;
my $pid = fork;
- ftp_abort('failed to fork child for gpgv')
+ ftp_abort "failed to fork child for gpgv: $!"
unless defined $pid;
unless ($pid) {
my $intro_status = 0; my $check_status = 0; my $verdict_status = 0;
open my $status, '<', \($ret->{raw_status})
- or ftp_abort('open in-memory file for gpgv status');
+ or ftp_abort "open in-memory file for gpgv status: $!";
while (<$status>) {
chomp;
unless (m/^\[GNUPG:\] /g) {
$ret->{sig_expiration} = $5 if $5 > 0;
}
}
- close $status or ftp_abort('close in-memory file for gpgv status');
+ close $status or ftp_abort "close in-memory file for gpgv status: $!";
push @{$ret->{TILT}}, 'gpgv reported more than one signature'
if $intro_status > 1;