Hi, I am pretty useless at Perl. (Disclaimer over) Basically, I have written a viewer which will read log files over the web. Problem is however, I have written a function which executes as follows -
sub grep
{
$cmd_line = "egrep \"${regexp}\" ${qual_file}";
&generic_command;
}
regexp is the search string as entered in a text field and qual_file is the name of the selected file.
This grep command works fine and I can see the contents of the file on screen ok. The problem is though is that this can be broken and there is nothing to stop a malicious user from doing a rm command or something similar. Any ideas as to how I can get around this?
sub grep
{
$cmd_line = "egrep \"${regexp}\" ${qual_file}";
&generic_command;
}
regexp is the search string as entered in a text field and qual_file is the name of the selected file.
This grep command works fine and I can see the contents of the file on screen ok. The problem is though is that this can be broken and there is nothing to stop a malicious user from doing a rm command or something similar. Any ideas as to how I can get around this?