From 54160e02929d66438707831257a51d9af79968e6 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Fri, 15 Sep 2023 19:25:25 -0500 Subject: [PATCH] Move file staging to installation check step --- gatekeeper.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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; } -- 2.25.1