Skip to content

Conversation

@DrHyde
Copy link
Contributor

@DrHyde DrHyde commented Mar 26, 2023

This PR adds automatic testing with this option enabled, and updates the tests that fail in the lib/ and t/ directories. There are also currently some failures in cpan/ - I have raised PRs for those. You can see in the history for this branch that I fixed them in this repo to make sure the fix worked then reverted when I raised the PRs upstream. Once they've been merged upstream I will edit history to make them disappear from here:

This PR shouldn't be merged - and will fail its tests - until those have been merged upstream and then also updated in perl5-blead.

The fix in the tests is quite straightforward. Checking $Config{taint_support} is insufficient for -DSILENT_NO_TAINT_SUPPORT, so it adds checks that look for that in $Config{ccflags}.

DrHyde added 12 commits March 25, 2023 22:46
Revert this before creating PR!
This should be reverted before merge, as Encode is dual-life CPAN-first
This should be reverted before merge, as Scalar-List-Utils is dual-life CPAN-first
This should be reverted before merge, as Test-Harness is dual-life CPAN-first
This should be reverted before merge, as Text-ParseWords is dual-life CPAN-first
@Leont
Copy link
Contributor

Leont commented Mar 26, 2023

The fix in the tests is quite straightforward. Checking $Config{taint_support} is insufficient for -DSILENT_NO_TAINT_SUPPORT, so it adds checks that look for that in $Config{ccflags}.

I'm not sure that's the right conclusion. The whole point of the taint_support option was that we don't have to dive into ccflags.

@DrHyde
Copy link
Contributor Author

DrHyde commented Mar 26, 2023

That's the only trace I could find of the option that's available to perl after it's been built. taint_support doesn't seem to get set by anything at all - but I assume I'm missing something.


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

@Leont
Copy link
Contributor

Leont commented Mar 26, 2023

That's the only trace I could find of the option that's available to perl after it's been built. taint_support doesn't seem to get set by anything at all - but I assume I'm missing something.

I think that question is somewhat answered by 28003a9

@demerphq
Copy link
Collaborator

demerphq commented Mar 27, 2023

taint_support doesn't seem to get set by anything at all - but I assume I'm missing something.

@DrHyde, @Leont: Hopefully when that patch gets resurrected, next dev cycle I guess (we/I forgot about it this dev cycle), the var wont be named "taint_support", but rather "taint_disabled".

It should never have been expressed as a positive config value given the history that we always supported taint, and that we historically had no setting to say so. Thus introducing a new setting that says we do have it now, when we always had it makes code awkward. Having two types of disablement just makes it even worse.

I believe the thinking was "in the future we will have no taint support at all", but that is an unforced error where the false state of the config value has a different meaning depending on the version of perl (eg it introduces the notion that exists-and-false != not-exists). It also makes the interim logic where there are two forms of disablement more painful, as proved to be the case from the get-go, as part of the reason the patch was not merged was if you did not use Configure's Q&A to set the define and instead set it via ccflags with something like '-Accflags=-DNO_TAINT_SUPPORT', the taint_support config value would not be set correctly. Much better to keep the setting negtive (as in taint_disabled) and when/if we remove taint entirely we just hardwire that setting to "taint_disabled=yes".

For this reason I don't think these patches should check "taint_support" at all. If anything I would check "taint_disabled" and if it is not set then I would check the ccflags. In the future 'taint_disabled' /might/ get set up without updating ccflags, but it is also conceivable it is set up AND the ccflags are setup, and historical perls will not have either "taint_support" nor "taint_disabled" and will only have the ccflags set up, so checking ccflags as a fallback makes sense no matter what.

FWIW, The taint configure patch was released fairly late in the 35.x cycle, and we didn't have a lot of time to find and fix the conceptual or implementation issues in the patch sequence until it was released. FWIW, I had meant to follow up on it in 5.37.x but it slipped my mind until I saw this PR.

# 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".

my $NoTaintSupport = exists($Config{taint_support}) && !$Config{taint_support};
my $NoTaintSupport =
(exists($Config{taint_support}) && !$Config{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/;

@DrHyde
Copy link
Contributor Author

DrHyde commented Mar 28, 2023

@DrHyde, @Leont: Hopefully when that patch gets resurrected, next dev cycle ...

In that case I'll close this PR for now. @demerphq would you like a reminder after 5.38 is out so it doesn't get forgotten again? :-)

@DrHyde DrHyde closed this Mar 28, 2023
@demerphq
Copy link
Collaborator

would you like a reminder after 5.38 is out so it doesn't get forgotten again? :-)

Sure, can't hurt.

yves

demerphq added a commit that referenced this pull request Mar 29, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Mar 30, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Mar 30, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Mar 30, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Mar 30, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Mar 31, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Apr 1, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Apr 2, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
demerphq added a commit that referenced this pull request Apr 2, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: #20972

for related work that is stalled because we have not decided what
to do about these variables.
pjacklam pushed a commit to pjacklam/perl5 that referenced this pull request May 20, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: Perl#20972

for related work that is stalled because we have not decided what
to do about these variables.
pjacklam pushed a commit to pjacklam/perl5 that referenced this pull request May 20, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: Perl#20972

for related work that is stalled because we have not decided what
to do about these variables.
khwilliamson pushed a commit to khwilliamson/perl5 that referenced this pull request Jul 10, 2023
This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config.
This way people can use them while we decide what to do about the
changes to Configure. We shouldn't need to have Configure changed to
export status variables like this in Config.pm

See: Perl-Toolchain-Gang/Test-Harness#118
and: Perl#20972

for related work that is stalled because we have not decided what
to do about these variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants