diff options
author | Yves Orton <demerphq@gmail.com> | 2022-04-20 06:44:08 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-04-20 06:45:43 +0200 |
commit | 9eb153ffbbde62558146e8f9b837034f42878e13 (patch) | |
tree | f05d906f05de9116ad1b0b4a6826cf2895ebaec9 /t | |
parent | c2e0d3bb9f0e8d6999bfa6c5d969f505012bcf72 (diff) | |
download | perl-9eb153ffbbde62558146e8f9b837034f42878e13.tar.gz |
Revert "mg.c, Cwd.pm - Empty path is the same as "." which is forbidden under taint"
This reverts commit 5ede4453c4877110eb5214ff400c173210b101b1.
I messed up and pushed it to blead not to the PR branch I meant to push
it. Thanks to xenu for noticing. This needs a smoke before it should be
applied.
Diffstat (limited to 't')
-rw-r--r-- | t/op/taint.t | 19 | ||||
-rw-r--r-- | t/test.pl | 5 |
2 files changed, 3 insertions, 21 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 49342f208d..c1ca6d345c 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -18,7 +18,7 @@ use strict; use warnings; use Config; -plan tests => 1061; +plan tests => 1054; $| = 1; @@ -138,17 +138,14 @@ my $TEST = 'TEST'; { $ENV{'DCL$PATH'} = '' if $Is_VMS; - # Empty path is the same as "." on *nix, so we have to set it - # to something or we will fail taint tests. perhaps setting it - # to "/" would be better. Anything absolute will do. - $ENV{PATH} = '/usr/bin'; + $ENV{PATH} = ($Is_Cygwin) ? '/usr/bin' : ''; delete @ENV{@MoreEnv}; $ENV{TERM} = 'dumb'; is(eval { `$echo 1` }, "1\n"); SKIP: { - skip "Environment tainting tests skipped", 11 + skip "Environment tainting tests skipped", 4 if $Is_MSWin32 || $Is_VMS; my @vars = ('PATH', @MoreEnv); @@ -160,16 +157,6 @@ my $TEST = 'TEST'; } is("@vars", ""); - # make sure that the empty path or empty path components - # trigger an "Insecure directory in $ENV{PATH}" error. - for my $path ("", ".", "/:", ":/", "/::/", ".:/", "/:.") { - local $ENV{PATH} = $path; - eval {`$echo 1`}; - ok($@ =~ /Insecure directory in \$ENV\{PATH\}/, - "path '$path' is insecure as expected") - or diag "$@"; - } - # tainted $TERM is unsafe only if it contains metachars local $ENV{TERM}; $ENV{TERM} = 'e=mc2'; @@ -776,11 +776,6 @@ sub untaint_path { $path = $path . $sep; } $path = $path . '/bin'; - } elsif (!$is_vms and !length $path) { - # empty PATH is the same as a path of "." on *nix so to prevent - # tests from dieing under taint we need to return something - # absolute. Perhaps "/" would be better? Anything absolute will do. - $path = "/usr/bin"; } $path; |