-
Notifications
You must be signed in to change notification settings - Fork 602
Fix tests when -DSILENT_NO_TAINT_SUPPORT is defined #20972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests when -DSILENT_NO_TAINT_SUPPORT is defined #20972
Conversation
Revert this before creating PR!
…SUPPORT is turned on
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
This reverts commit 1e7ac3b. A PR has been created for upstream: dankogai/p5-encode#172
This reverts commit bca1c72. A PR has been created upstream: Dual-Life/Scalar-List-Utils#124
This reverts commit d4fa19e. A PR has been created for upstream: Perl-Toolchain-Gang/Test-Harness#118
This reverts commit c61fb35. A PR has been created upstream: neilb/Text-ParseWords#2
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. |
|
That's the only trace I could find of the option that's available to perl after it's been built. |
|
|
||
| my $no_taint_support = exists($Config::Config{taint_support}) | ||
| && !$Config::Config{taint_support}; | ||
| my $NoTaintSupport = |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
I think that question is somewhat answered by 28003a9 |
@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}) || |
There was a problem hiding this comment.
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/; |
There was a problem hiding this comment.
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/;
Sure, can't hurt. yves |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This PR adds automatic testing with this option enabled, and updates the tests that fail in the
lib/andt/directories. There are also currently some failures incpan/- 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}.