Hi monks,
If I may impose again on your wisdom. I get the following errror:
Insecure $ENV{PATH} while running with -T switch at /home/www/cgi-bin/xilogin.cgi line 166, <CONFIG> line 189.
With the following code:
elsif ($get eq "password") {
# Get user's e-mail
my $username = param('username');
if ($username) {
my $sql = "SELECT * from $meta_configs{login_table} where $meta_co
+nfigs{login_username} LIKE '$username'";
my $sth = $dbh->prepare("$sql") or &graceful_exit("Cannot prepare
+SQL statement: $DBI::errstr",$sql);
$sth->execute or graceful_exit("Cannot execute: $DBI::errstr",$sql
+);
my $rows = $sth->rows;
my $email; my $db_username; my $password;
while (my $hash_ref=$sth->fetchrow_hashref) {
$email = $hash_ref->{email};
$db_username = $hash_ref->{"$meta_configs{login_username}"};
$password = $hash_ref->{password};
}
$sth->finish;
# send password:
open (MAIL, "| /usr/lib/sendmail $email");
The last line is the offending one. The variable $email comes not from a CGI param, but from a database query.
And yes, I can (and will) simply pass it through a regexp, but I'm interested in the why here, not the immediate solution to my problem.
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.