Elijah has asked for the wisdom of the Perl Monks concerning the following question:
Now with that said I of course am using taint mode so in order to pass data to an open() call I am piping to "-" and trying to temporarily printing the output of the whois command to a cgi generated webpage just to verify the data is there before I extract the email address. However the return value of my filehandle is null and I can not see any reason why it would be this way. I have taken this example and put it in a test command line script and it executes like it is suppose to.
Here is the section of code:
As you can see I have commented out the real exec() call I want to run and simply am trying to get the output to list the contents of the current dir. I get nothing printed from the print statement however.if ($domain) { open(LKUP, "-|") || exec("ls"); #exec("whois", $domain); print while <LKUP>; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Safe open() with taint mode not working?
by dave_the_m (Monsignor) on Jan 14, 2005 at 18:59 UTC | |
by Elijah (Hermit) on Jan 14, 2005 at 20:00 UTC | |
by dave_the_m (Monsignor) on Jan 14, 2005 at 22:29 UTC |