Skip to content
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

use taint on syntax check #172

Merged

Conversation

wielandp
Copy link
Contributor

@wielandp wielandp commented Feb 9, 2023

Like described in issue #143
Using taint check for syntax check to prevent error message
when first line is like "#!/usr/bin/perl -T" or "#!/usr/bin/perl -t"

@wielandp wielandp changed the title Ignore hashbang on syntax check use taint on syntax check Feb 16, 2023
@richterger
Copy link
Owner

This add's the -T taint check always, that might break other code that does not use tainting. I think taint checks should be an option.

@wielandp
Copy link
Contributor Author

That is what I thought first too. But in this case I use it only with -c for syntax checking.
Maybe you are right, because some code is executed when using -c. Not sure, begin blocks?
I can't really imagine code, that would break, but who knows.

The option version didn't look nice to me, since it should detect automatically and no need for adding options.

The third way to do it, would be scan the first line and apply -T if it is in the hash bang line.

Let me know, how to solve it

@richterger
Copy link
Owner

Actually also perl -c can execute code. For example all BEGIN blocks will run, also when you run perl -c . So I think -T should only be applied if necessary. I would go with your third idea, scan the first line and if there is -T in it, also apply it to perl -c.

Also it would be a good idea the the -T option also for the debugger. Here it would make sense to do automatic scaning of line 1 and in addition have an option to set -T independed of line 1

@wielandp
Copy link
Contributor Author

wielandp commented May 1, 2023

I go for the small solution (just option, no auto detect)

@wielandp
Copy link
Contributor Author

wielandp commented May 7, 2023

If I want to debug code with hashbang and taint, I have the same problem.
Shall I rename the option from "Use -T for syntax check." to ""Use -T for syntax check and debugging."?
Or shall I add a new config option for debugging? I will write a pull request for a new config option.
So the setting option is only for syntax check

@richterger
Copy link
Owner

Haveing a similar option in lauch.json for debugging, look like a very good idea.

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.

None yet

2 participants