From: Jacob Bachmeyer Date: Sat, 16 Sep 2023 00:25:25 +0000 (-0500) Subject: Move file staging to installation check step X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=54160e02929d66438707831257a51d9af79968e6;p=gatekeeper.git Move file staging to installation check step --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 42d3f8c..93226fe 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2418,19 +2418,33 @@ order. This is used to construct a message reporting success. (File::Spec->catfile(CONF_DIR_Scratch, $self->upload_filename)); } - sub install { + sub install_check { my $self = shift; # Invoking this without first authenticating the file is a serious bug. - abort 'internal error: installing unauthenticated file' + abort 'internal error: checking installation for unauthenticated file' unless $self->{auth_file_signature_info} && ($self->{auth_file_signature_info}{exitcode} == 0 && !defined $self->{auth_file_signature_info}{TILT}); + $self->SUPER::install_check; + # Do we need a subdirectory on CONF_DIR_Staging as well? Can't quite # picture when we'd have a collision, so skip that for now. move_filepair (CONF_DIR_Scratch, $self->upload_filename, CONF_DIR_Staging); + # Staging the file now should avoid the (remote) possibility of + # encountering ENOSPC during installation. + } + + sub install { + my $self = shift; + + # Invoking this without first authenticating the file is a serious bug. + abort 'internal error: installing unauthenticated file' + unless $self->{auth_file_signature_info} + && ($self->{auth_file_signature_info}{exitcode} == 0 + && !defined $self->{auth_file_signature_info}{TILT}); $self->SUPER::install; }