Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ jobs:
- "-Duserelocatableinc"
- "-Dcc='clang'"
- "-Dcc='g++'"
- "-Accflags=-DSILENT_NO_TAINT_SUPPORT"

steps:
- name: Install System dependencies
Expand Down
4 changes: 3 additions & 1 deletion lib/locale.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ my $is_ebcdic = ord("A") == 193;
my $os = lc $^O;

# Configure now lets you build a perl that silently ignores taint features
my $NoTaintSupport = exists($Config{taint_support}) && !$Config{taint_support};
my $NoTaintSupport =
(exists($Config{taint_support}) && !$Config{taint_support}) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would lose these checks entirely. I am very hopeful that we will never have a config variable called "taint_support".

$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you only checking SILENT_NO_TAINT_SUPPORT? Shouldn't this be

$Config{ccflags} =~ /-D(?SILENT_)?NO_TAINT_SUPPORT/;


no warnings 'locale'; # We test even weird locales; and do some scary things
# in ok locales
Expand Down
13 changes: 7 additions & 6 deletions lib/overload.t
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!./perl -T

use Config;
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config;
if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){
if (($Config{'extensions'} !~ m!\bList/Util\b!) ){
print "1..0 # Skip -- Perl configured without List::Util module\n";
exit 0;
}
}

my $no_taint_support = exists($Config::Config{taint_support})
&& !$Config::Config{taint_support};
my $NoTaintSupport =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change of naming style? All the rest of this file is snake case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the $NoTaintSupport in other files

(exists($Config{taint_support}) && !$Config{taint_support}) ||
$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/;

my %skip_fetch_count_when_no_taint = (
'<${$ts}> RT57012_OV' => 1,
Expand All @@ -24,7 +25,7 @@ my %skip_fetch_count_when_no_taint = (

sub is_if_taint_supported {
my ($got, $expected, $name, @mess) = @_;
if ($expected && $no_taint_support) {
if ($expected && $NoTaintSupport) {
return skip("your perl was built without taint support");
}
else {
Expand Down Expand Up @@ -2052,7 +2053,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
my $exp_fetch = ($var eq '$ts') ?
$exp_fetch_s : $exp_fetch_a;
SKIP: {
if ($skip_fetch_count_when_no_taint{$desc} && $no_taint_support) {
if ($skip_fetch_count_when_no_taint{$desc} && $NoTaintSupport) {
skip("your perl was built without taint support");
}
else {
Expand Down
6 changes: 4 additions & 2 deletions lib/perl5db.t
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,10 @@ sub _calc_trace_wrapper
}

# taint tests
if (!exists($Config{taint_support}) || $Config{taint_support})
{
if (
(!exists($Config{taint_support}) || $Config{taint_support}) &&
$Config{ccflags} !~ /-DSILENT_NO_TAINT_SUPPORT/
) {
my $wrapper = _calc_trace_wrapper(
{
prog => '../lib/perl5db/t/taint',
Expand Down
6 changes: 3 additions & 3 deletions t/lib/warnings/taint
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def
# taint.c
use Config;
BEGIN {
if ( exists($Config{taint_support}) && not $Config{taint_support}) {
if ( (exists($Config{taint_support}) && not $Config{taint_support}) || $Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/) {
print "SKIPPED\n# your perl was built without taint support\n";
exit 0;
}
Expand All @@ -30,7 +30,7 @@ def
# taint.c
use Config;
BEGIN {
if ( exists($Config{taint_support}) && not $Config{taint_support}) {
if ( (exists($Config{taint_support}) && not $Config{taint_support}) || $Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/) {
print "SKIPPED\n# your perl was built without taint support\n";
exit 0;
}
Expand Down Expand Up @@ -58,7 +58,7 @@ def
# taint.c
use Config;
BEGIN {
if ( exists($Config{taint_support}) && not $Config{taint_support}) {
if ( (exists($Config{taint_support}) && not $Config{taint_support}) || $Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/) {
print "SKIPPED\n# your perl was built without taint support\n";
exit 0;
}
Expand Down
4 changes: 3 additions & 1 deletion t/op/taint.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use strict;
use warnings;
use Config;

my $NoTaintSupport = exists($Config{taint_support}) && !$Config{taint_support};
my $NoTaintSupport =
(exists($Config{taint_support}) && !$Config{taint_support}) ||
$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/;

if ($NoTaintSupport) {
skip_all("your perl was built without taint support");
Expand Down
5 changes: 4 additions & 1 deletion t/perf/taint.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ BEGIN {
require Config; import Config;
require './test.pl';
skip_all_if_miniperl("No Scalar::Util under miniperl");
if (exists($Config{taint_support}) && !$Config{taint_support}) {
if (
(exists($Config{taint_support}) && !$Config{taint_support}) ||
$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/
) {
skip_all("built without taint support");
}
}
Expand Down
5 changes: 4 additions & 1 deletion t/run/runenv.t
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ try({PERL5OPT => '-w -w'},
'');

SKIP: {
if (exists($Config{taint_support}) && !$Config{taint_support}) {
if (
(exists($Config{taint_support}) && !$Config{taint_support}) ||
$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/
) {
skip("built without taint support", 2);
}
try({PERL5OPT => '-t'},
Expand Down
5 changes: 4 additions & 1 deletion t/run/switcht.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ BEGIN {

use Config;

if (exists($Config{taint_support}) && !$Config{taint_support}) {
if (
(exists($Config{taint_support}) && !$Config{taint_support}) ||
$Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/
) {
skip_all("perl built without taint support");
}

Expand Down