File: taint-workaround.t

package info (click to toggle)
libtest-version-perl 2.09-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 360 kB
  • sloc: perl: 843; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use strict;
use warnings;
use Test::More;
use File::Find;
use Test::Version;
use Cwd ();

my $untaint_pattern = $Test::Version::FILE_FIND_RULE_EXTRAS{untaint_pattern} || $File::Find::untaint_pattern;

note "untaint_pattern = $untaint_pattern";

my $cwd = Cwd::getcwd;

note "Cwd::getcwd = $cwd";

diag '';

if(defined $untaint_pattern)
{
  if($cwd =~ m|$untaint_pattern|)
  {
    note 'Looks good $cwd =~ $untaint_pattern';
  }
  else
  {
    diag "current working directory does not match untaint pattern:";
    diag "Cwd::getcwd = $cwd";
    diag "untaint_pattern = $untaint_pattern";
  }
}
else
{
  diag "unable to determine untaint pattern.";
}

# make sure this test passes. Intent is only to collect diagnostics atm.
ok 1;


done_testing;