in reply to Trouble emailing zip file
system("uuencode ${logfile} ${logfile} | mailx -s ${subject} -r ${rec +ipient1}");
Let's hope nobody sets subject to `rm -rf /`. You have created a shell injection vulnerability. Try to avoid using the shell, as others told you. If you absolutely can not avoid the shell, use the multi-argument form. See The problem of "the" default shell for the ugly details.
And as a bonus, you are not comparing here, but assigning:
if ($userid = $user1){ system("uuencode ....")
As long as $user1 contains a true value (i.e. everything but undef, 0 or the empty string), system will be executed, no matter what $userid once contained.
If you want to compare strings, use eq. For numbers, use ==. (How to remember that.)
Alexander
|
|---|