I have Perl script I would like to run as CGI script with the tainting option on. So on the top line, the script has: #!/usr/bin/perl -wT
However when the server invokes this script, it started Perl without the tainting option. So the script fails because when perl sees the script, it was already started without tainting option. What I'd like is to tell Hiawatha that perl should start with tainting on (via -T option). However when I tried to change hiawatha.conf to have: CGIhandler = /usr/bin/perl -T:pl or CGIhandler = '/usr/bin/perl -T':pl then it doesn't work because Hiawatha cannot find the executable.
How can I signify to Hiawatha how to start Perl with options? Thank you.
Alex
3 March 2017, 22:51
I see someone already has a similar question. But there has been no answer all these years. Does it mean it is impossible?
Hugo Leisink
4 March 2017, 00:37
If all your scripts start with #!/... try the CGIextension instead of the CGIhandler.
Alex
7 March 2017, 01:32
Do you mean just uncomment the line for CGIextension? And leave all the CGIhandler untouched? I did that but got the error "Method Not Allowed" and I'm not sure if it's something I need to do to configure, or if it's something else. Also, eventually I'd like to do CGI wrapper with the flag -T on. From what I read here: https://www.hiawatha-webserver.org/howto/cgi_wrapper it looks like the instruction is only for CGIhandler? Not sure if there's a way to have wrapper with CGIextension (or rather, the ultimate objective which is to have wrapper with the -T flag on).
Alex
7 March 2017, 01:42
Never mind the CGIextension, I've got it working now. Am still not sure how to combine CGIwrapper and CGIextension though.
Hugo Leisink
7 March 2017, 10:09
As long as the CGI is placed inside the cgiroot as defined in cgi-wrapper.conf, it will work. No need for CGIextension there.