Subject: | Program code is executed twice while using the MIME-Lite Modul |
Program code is executed twice while using the MIME-Lite Modul.
The problem occurs in the following situtation:
I executed the taint-save 'send' method in an 'eval' environment.
But the sendmail command can't be 'exec()' (wrong path, never mind)
and the child process is reached the 'die "can't exec...'.
This should terminate the child but it did not because it is inside of
an 'eval'-block.
The child runs out of the eval and to a normal program ending.
The father wait until the child is comming to an end and runs to a
normal program ending too.
e.g. program code is executed twice, this could be very critical.
My suggestion is to termiate the child process by exit() instead of die().
Below you can see the concerned code snippet from the MIME-Lite send-method:
my $pid = open SENDMAIL, "|-";
defined($pid) or die "open of pipe failed: $!\n";
if (!$pid) { ### child
exec(@cmd) or die "can't exec $p{Sendmail}: $!\n";
### NOTREACHED
}
else { ### parent
$self->print(\*SENDMAIL);
close SENDMAIL || die "error closing $p{Sendmail}: $! (exit $?)\n";
return 1;
}
greetings
robert