Move file staging to installation check step
authorJacob Bachmeyer <jcb@gnu.org>
Sat, 16 Sep 2023 00:25:25 +0000 (19:25 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Sat, 16 Sep 2023 00:25:25 +0000 (19:25 -0500)
gatekeeper.pl

index 42d3f8c70ecd4739068a2f9c5c297f6707f71985..93226fe34b91d3554af35b876df81dd0976cc388 100755 (executable)
@@ -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;
   }