Meet taint mode requirements for handling test syslog socket name
authorJacob Bachmeyer <jcb@gnu.org>
Sat, 27 Feb 2021 03:19:16 +0000 (21:19 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Sat, 27 Feb 2021 03:19:16 +0000 (21:19 -0600)
upload-ftp-v1.2.pl

index 78c2eeeedc0ac66666738037ff908ef7b71164ba..e57f56f2b68681851853de4475980d015f8d226c 100755 (executable)
@@ -242,7 +242,12 @@ sub main
 {
 
   # Initialize our syslogging
-  setlogsock(unix => $ENV{TEST_SYSLOG_SOCKET}) if IN_TEST_MODE;
+  if (IN_TEST_MODE) {
+    $ENV{TEST_SYSLOG_SOCKET} =~ m/^([[:alnum:]\/]+)$/
+      or die "strange test syslog socket";
+    -S $1 or die "test syslog socket is not a socket";
+    setlogsock(unix => $1);
+  }
   openlog("ftp-upload", 'pid', $facility);
   ftp_syslog('info', "($log_style) Beginning upload processing run.");