Something else you should consider is that you are opening yourself for a potential attack by allowing the user to supply data that you will feed to system, etc. You really should consider using Safe to scrub the data for things like cat /etc/passwd or rm -rf /. Try running these these two pieces of code on your *nix environment:
# BAD! perl -E'my $cmd = "@ARGV"; print `$cmd`' cat /etc/passwd
# BETTER! perl -MSafe -E'my $c=Safe->new; my $cmd = $c->reval("@ARGV"); print `$ +cmd`' cat /etc/passwd
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: how to call system commands from cgi file?
by jeffa
in thread how to call system commands from cgi file?
by kpofcochin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |