[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SAGE] Output from "cron" command



| From: merlyn@stonehenge.com (Randal L. Schwartz)
| 
| John>     14 3 * * * /usr/local/sbin/DAILY_stuff 2>&1 | \
| John> 	/usr/local/bin/ifinput /usr/bin/mailx \
| John> 	-s "`/bin/uname -n` DAILY_stuff output" jsellens
| 
| And now if somehow I can get DAILY_stuff to spit out a line
| that starts with a tilde, you've just b33n 0wn3d.
| 
| Don't use mailx.  Or at least not until it can be told "don't
| interpret lines that start with tilde specially".

I haven't tested this (recently?), but the Solaris 2.5.1 man page
for mailx(1) describes the -~ option
     -~              Interpret tilde escapes in the input even if
		     not reading from a tty.
which implies that a ~ in a pipe would not have any unfortunate
effects.  The FreeBSD mail(1) command needs -I to interpret tildes
when input is not a terminal.

I think the old Berkeley mail command may have had this problem,
but it seems to have been fixed in many (most?) places by now.
(I think we fixed it at UWaterloo 1987/08/28 if the RCS log can
be believed.)

But you're right - it's almost always a bad idea to use a
program made for interactive use in a non-interactive way,
because of just these possibilities.

I just fell into bad habits because I knew I could trust
my environment. :-)

Cheers!

John