# We trust our test environment, but taint mode forces this issue.
$FindBin::Bin =~ m[^(/[[:graph:] ]+)$]
or die "strange base path for test environment";
+
my $gpgv_mock = File::Spec->catfile($1, qw(testsuite lib exec mockgpgv));
constant->import(GPGV_BIN => $gpgv_mock);
+
+ my $sys_mock = File::Spec->catfile($1, qw(testsuite lib exec mocktool));
+ constant->import(LSOF_BIN => $sys_mock, 'lsof');
} else {
constant->import(GPGV_BIN => '/usr/bin/gpgv');
+ constant->import(LSOF_BIN => '/usr/bin/lsof');
}
}
my $facility = "LOCAL5";
if (IN_TEST_MODE) { # override the above for testing
- # override PATH
# override file paths to our testcase environment
{
# Again, the test environment is trusted, but we still run in taint mode.
# If neither of those 2 conditions are met, the lsof call will not see
# the open files because they are owned by another user.
# On modern (Debian) systems, condition a) is not met.
- my @lsof_args = ("/usr/bin/lsof", "-Fn",
+ my @lsof_args = (LSOF_BIN, "-Fn",
map { "$incoming_dir/$_" } keys %possible);
ftp_syslog('debug', "($log_style) DEBUG: " . "lsof command line: " . join(' ',@lsof_args)) if $DEBUG;
my $pid = open (LSOF, "-|");