my $cmd = join(' ', '/bin/mail', @ARGV);Isn't this unsafe argument handling? AFAIU, this should break if ran as mail-if root@localhost -s "innocent_message & touch /root/evilfile" (and all kinds of other wierd behaviour are possible with quoted arguments becoming unquoted). Also, checking for data present on STDIN is easier using eof. Therefore, a simplier solution might look like this: perl -e'exec "/bin/mail", @ARGV unless eof STDIN' (untested).
In reply to Re: Sanity check: Tiny wrapper script for /bin/mail
by aitap
in thread Sanity check: Tiny wrapper script for /bin/mail
by FloydATC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |