From 3210bffe959bb6c2f19dd7a65f4176bd0e1cdb4e Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 13 Nov 2021 19:08:28 -0600 Subject: [PATCH] Meet taint mode requirements for handling test SMTP port --- upload-ftp-v1.2.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upload-ftp-v1.2.pl b/upload-ftp-v1.2.pl index 02417c7..b59b71f 100755 --- a/upload-ftp-v1.2.pl +++ b/upload-ftp-v1.2.pl @@ -271,7 +271,8 @@ if (IN_TEST_MODE) { # override the above for testing } # verify configuration for mock smtpd die "ftp-upload: test mode: TEST_SMTP_PORT not valid" - unless $ENV{TEST_SMTP_PORT} && $ENV{TEST_SMTP_PORT} =~ m/^\d+$/; + unless $ENV{TEST_SMTP_PORT} && $ENV{TEST_SMTP_PORT} =~ m/^(\d+)$/; + $ENV{TEST_SMTP_PORT} = $1; # untaint the test SMTP port number # verify configuration for mock syslog die "ftp-upload: test mode: TEST_SYSLOG_SOCKET not valid" unless $ENV{TEST_SYSLOG_SOCKET} && -S $ENV{TEST_SYSLOG_SOCKET} && -w _; -- 2.25.1