From 821369b6ec4f25b3ea298828c72f9f5597406b64 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Fri, 4 Aug 2023 18:45:15 -0500 Subject: [PATCH] Begin to move specialized helpers into their packet classes --- gatekeeper.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 27548cb..2e09ece 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1753,9 +1753,9 @@ sub read_directive_from_string { $self->{directive} = ::read_directive_from_string($self->{directive_text}); - $self->{oplist} = ::interpret_directive($self->{directive}); + $self->{oplist} = interpret_directive($self->{directive}); - ::validate_directive($self, $self->{oplist}); + validate_directive($self, $self->{oplist}); } sub auth_clearsigned_message { (shift)->{directive_text} } @@ -1886,7 +1886,7 @@ sub read_directive_from_string { my $self = shift; # Check uploaded file for known Automake CVE issues. - ::check_automake_vulnerabilities + check_automake_vulnerabilities (File::Spec->catfile(::CONF_DIR_Scratch, $self->upload_filename)); } @@ -1901,7 +1901,7 @@ sub read_directive_from_string { # 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 + move_filepair (::CONF_DIR_Scratch, $self->upload_filename, ::CONF_DIR_Staging); $self->SUPER::install; @@ -2172,7 +2172,7 @@ The values in the returned structure are untainted. =cut -sub interpret_directive { +sub Local::Packet::Directive::interpret_directive { my $directive = shift; # presumed tainted my @errors; @@ -2368,7 +2368,7 @@ An exception is thrown if validation fails. =cut -sub validate_directive { +sub Local::Packet::Directive::validate_directive { my $packet = shift; my $ops = shift; @@ -2945,7 +2945,7 @@ exception if UPLOAD_FILE is found to be exploitable. =cut -sub check_automake_vulnerabilities { +sub Local::Packet::Directive::Upload::check_automake_vulnerabilities { my $upload_file = shift; die "file not found: $upload_file" @@ -3067,7 +3067,7 @@ by File::Spec->catdir on the local system. =cut -sub move_filepair { +sub Local::Packet::Directive::Upload::move_filepair { my $source = shift; my $filename = shift; my $target = shift; -- 2.25.1