*BSD News Article 20618


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!natinst.com!hrd769.brooks.af.mil!hrd769.brooks.af.mil!not-for-mail
From: burgess@hrd769.brooks.af.mil (Dave Burgess)
Newsgroups: comp.os.386bsd.bugs
Subject: Problems with new execle() in NetBSD 0.9
Date: 8 Sep 1993 12:53:40 -0500
Organization: Armstrong Laboratory, Brooks AFB, TX
Lines: 40
Message-ID: <26l67i$6qs@hrd769.brooks.af.mil>
NNTP-Posting-Host: hrd769.brooks.af.mil


I have been wrestling with this cron problem for a couple of weeks.
Here is the manifestation:

>From: root (Cron Daemon)
>To: root
>Subject: cron for root@hrd769 said this
>X-Cron-Cmd: </usr/bin/finger	nasanews@space.mit.edu > /etc/nasanews>
>X-Cron-Env: <SHELL=/bin/bash>
>X-Cron-Env: <HOME=/usr/root>
>X-Cron-Env: <PATH=/usr/sbin:/usr/bin:/usr/local/bin:/bin:/etc:/sbin:>
>X-Cron-Env: <USER=root>
>Status: OR

/usr/bin/finger	nasanews@space.mit.edu > /etc/nasanews: No such file or directory


In crond, the command above is passed as a single argument to sh (or
bash, or whatever).  In other words, it was as if I typed the following
at the shell prompt:

sh -c "/usr/bin/finger	nasanews@space.mit.edu > /etc/nasanews"

The problem with that is that the shell runs out looking for a program
called "/usr/bin/finger	nasa....".  That is obviously wrong.  

The old execle could parse this, but apparently the new execle can't.  I
have tried a couple a fixes to this, including changing the cron daemon
so that the cmd string was broken up into a table of the args using and
a strsep() loop and execv().  I end up with either nothing happening (as
if the cmd is NULL) or the existing behaviour.

Commands which do not require arguments or flags (/etc/daily, for
example) all work just fine.

-- 
------
TSgt Dave Burgess
NCOIC AL/Management Information Systems Office
Brooks AFB, TX