Add a ./Configure "use taint" option - #24640
Conversation
|
And a fourth reason: |
|
Ahah; turns out point 4 may be more pressing than I expected. It fails sanity tests because of this: |
1150816 to
4e6b717
Compare
|
Much failure all round. I wonder if @Tux might be able to offer any guidance here? |
|
Most of these files just need a default value for the new variable, see 1f9097b for an example. |
66a185c to
99d88bb
Compare
|
Right. That's item 4 sorted. But items 1 to 3 remain. |
| @@ -264,7 +264,7 @@ jobs: | |||
| - "-Dcc='clang'" | |||
| - "-Dcc='g++'" | |||
| - "-Accflags=-DSILENT_NO_TAINT_SUPPORT" | |||
There was a problem hiding this comment.
This makes the interface to SILENT_NO_TAINT_SUPPORT a bit awkward. Should that be a separate configuration flag? Should it be the default when usetaint is undefined? (you can't install most of CPAN without it)
There was a problem hiding this comment.
I could imagine adding a separate flag but if as you say, most of CPAN doesn't even install without either taint or SILENT_NO_TAINT, I can't imagine it being useful.
I think there's in practice only two useful states - taint on, or silent taint off. Both are now covered by the -D vs -U setting of usetaint.
khwilliamson
left a comment
There was a problem hiding this comment.
The units are automatically sorted in Configure by the mconfig command. You can influence the order with the ?Y command in the .U file. The sort is done minorly for consistency, but mostly to make sure that a unit doesn't rely on a unit that comes later in Configure.
You should be religiously using as a cookbook the README file in the metaconfig directory (above the U) one (patches welcome). It tells you you need to patch metaconfig.h, which hasn't been done here.
I'm unsure if you ran "Porting/checkcfgvar.pl", and similar tools listed in the README
99d88bb to
3b49f8f
Compare
Oh I don't mind what order these run in; it doesn't look like it really matters. My concern was simply that, starting from a clean checkout of both perl5 and metaconfig, simply rerunning the generator already produced changes when I expected there to be none. That confused me - I wasn't sure if it was expected.
I did read the section about metaconfig.h, but that seemed to be explaining that you need to add it there if it doesn't turn up yet because no code is actually yet using the macro. Since I had already added code in perl.h which really does use the macro, that didn't appear to be necessary. But is it standard practice to list it there anyway even so?
I did run |
|
As long as you ran all the things that cookbook says, and took care of any messages, I'm happy with that portion. I'm trying to understand about |
|
I know from bitter experience that if you don't have that symbol defined, that everything seemingly works, but will fail to compile when starting with a clean workspace. |
Part of the PR; see #ifndef PERL_USE_TAINT |
|
OK, well... As it stands it doesn't consider the
There is no equivalent for setting the SILENT option. I don't have a good feel for what that should be - any suggestions? |
IMNSHO the silent flag should be the default if Instead of a silent flag, we should have a loud flag as an option for people who want such behavior. |
9a4c661 to
9bd9f7b
Compare
OK; latest behaviour: default taint is on. |
|
Ah. The That test file starts with: use Test::More $Config{ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/
? ( skip_all => 'No taint support' ) : ( tests => 2 );as a way to detect if taint mode is supported, by looking in |
Huh. Actually it turns out this appears to literally be the only module doing this: https://grep.metacpan.org/search?q=DSILENT_NO_TAINT_SUPPORT&qft=*.t&qd=&qifl= And no hits at all for the name without the leading "D". I am slightly suspicious - what does anyone else do? |
MetaCPAN grep can only find one other dist affected, so I guess it's fine. They'll just have to adapt to the new situation ( |
|
It is on my radar (now). I'll try to share some thought soon(ish) |
I have no idea why, but this block was moved into a different position after a rebuild with no apparent edits. Perhaps something subtle in filesystem sort order? In any case it doesn't appear overly significant.
./Configure -Dusetaint ... ./Configure - builds a perl with taint support ./Configure -Uusetaint ... - builds a perl without taint support Option defaults to on, matching current behaviour.
Easier just to ask if $0 is tainted, as that is a more reliable way to check if taint mode is supported. Perl-Toolchain-Gang/Module-Metadata#40 (comment) This needs sending back upstream to Module-Metadata itself.
dfeabbd to
e142590
Compare
|
I've now updated the way that |
Updates the
./Configurescript to allow control of whether we build taint support or not. Created from the underlying metaconfig change Perl/metaconfig#94.Three reasons make me nervous here, looking for some good review:
mconfigapplied before I had even edited any files. Someone who knows these things ought to look into why that happened.Configuresets the "USE_TAINT" macro whichperl.hthen inverts to create theNO_TAINT_SUPPORTwhich is used everywhere else in the code. I think it would be a lot neater for all the other code to just be conditional onUSE_TAINTdirectly. But that's a rather larger edit than I really wanted to do here, plus the "SILENT_NO_TAINT_SUPPORT" complicates it further.