Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New /etc/default/cron from OSS642a - Cron supplement

6 views
Skip to first unread message

alex stuart

unread,
Dec 16, 2002, 8:09:58 AM12/16/02
to
Hello dustbusters!

It appears that during the install of the oss642a patch, a new
/etc/default/cron is installed. It sets a more secure PATH than
before (TA117784)[1] and also appears to set other variables:
NOTESHELL, INPUT, OLDPARSING.

I have checked the man pages, the SCO site and on pcunix.com and
cannot determine what they are for. A script run from cron does
not get passed these as envvars so should I worry about them? Are
they internal to the cron daemon?

Regards,
Alex

[1] I guess a thorough audit of shell scripts run from cron is
required to ensure the PATH is explicitly set or that each command
has a full pathname. Oh joy!

Jean-Pierre Radley

unread,
Dec 16, 2002, 12:16:23 PM12/16/02
to ScoMisc [c.u.s.m]
alex stuart typed (on Mon, Dec 16, 2002 at 05:09:58AM -0800):

| Hello dustbusters!
|
| It appears that during the install of the oss642a patch, a new
| /etc/default/cron is installed. It sets a more secure PATH than
| before (TA117784)[1] and also appears to set other variables:
| NOTESHELL, INPUT, OLDPARSING.
|
| I have checked the man pages, the SCO site and on pcunix.com and
| cannot determine what they are for. A script run from cron does
| not get passed these as envvars so should I worry about them? Are
| they internal to the cron daemon?

But /etc/default/cron describes the purpose of each of those
variables; which part of the text leaves you with "cannot
determine what they are for"?


--
JP

alex stuart

unread,
Dec 17, 2002, 5:59:48 AM12/17/02
to
Jean-Pierre Radley <j...@jpr.com> wrote in message news:<20021216171...@jpradley.jpr.com>...

> alex stuart typed (on Mon, Dec 16, 2002 at 05:09:58AM -0800):
> | It appears that during the install of the oss642a patch, a new
> | /etc/default/cron is installed.
<snip>
> But /etc/default/cron describes the purpose of each of those
> variables; which part of the text leaves you with "cannot
> determine what they are for"?

Did it? I read only the lines that appeared to be shell envvar assignment
statements. I'm sorry I can't recheck this: I lost my job yesterday and
now don't have access to an OpenServer box.

/etc/default/cron appeared to have the same syntax as a shell script. It
has lines like "OLDPARSING=YES" which appears to be an assignment; and
comments are introduced with a "#". When I ran a shell script from cron,
I could echo the PATH variable, set as above, but was unable to access
the NOTESHELL, INPUT and OLDPARSING envvars (l.h.sides?). I did not notice
a new man page distributed with the VOLS containing descriptions.


It's been an education reading this group. Many Thanks CUSM via google.

Alex

Bela Lubkin

unread,
Dec 17, 2002, 2:44:42 PM12/17/02
to sco...@xenitec.on.ca
alex stuart wrote:

A new man page was not included, but comments were added to
/etc/default/cron, as JPR stated. I just downloaded a fresh copy of
oss642a, extracted etc/default/cron from it, and here is an excerpt:

# NOTESHELL - If set to YES, users submitting cron and at jobs are
# notified if their login shell is different from the shell
# that is used by cron to run jobs.

Setting this to NO turns off the annoying warning:

"warning: commands will be executed using /bin/sh"

# INPUT - If set to NO, the cron job input mechanism is disabled:
# neither % nor \ are changed, removed, or otherwise treated
# specially.
# OLDPARSING - If set to YES, \ and % in cron jobs are acted on in the
# way they were up through OpenServer 5.0.6.

These control the parsing of lines in a crontab. It is an attempt to
get control over an old feature that few people knew about, but which
caused trouble in some crontabs: '%' means `newline'.

There are three combinations:

INPUT=YES, OLDPARSING=YES -- acts like cron in OSR506 and earlier. If
there are any '%' chars in a crontab command field, they are converted
to newlines. The command (everything before the first newline) is
passed the rest as standard input. So:

* * * * * cat%foo%bar%

means: ``every minute, run `cat`, passing as standard input a file
with 2 lines containing the texts "foo" and "bar"''.

=========================================================================

INPUT=YES, OLDPARSING=NO (default configuration in OSR507 and oss642a)
-- same, except now you can prevent the special interpretation of '%'
chars with a backslash. So:

* * * * * echo foo%bar

means: ``every minute, run `echo foo`, passing as stdin a file with
one line containing "bar"''. But:

* * * * * echo foo\%bar

means: ``every minute, run `echo foo%bar`''.

NOTICE that this changes the meaning of '\' in existing crontabs. To
express a literal '\' you need two of them:

* * * * * printf "This outputs\\ntwo lines."

=========================================================================

INPUT=NO, OLDPARSING=(ignored) -- characters '%' and '\' have no
special meaning in crontab lines. So:

* * * * * echo foo%bar
* * * * * echo foo\%bar

means: ``every minute, run `echo foo%bar`'', and ``every minute, run
`echo foo\%bar`''

>Bela<

0 new messages