su in crontab

William L. Sebok wls at astrovax.UUCP
Sun Jan 12 05:25:31 AEST 1986


I just tripped over a rather puzzling anomaly.  If I insert 

08 * * * * su wls % exec /usr/ucb/whoami >>/mnt/wls/TST/Errors 2>&1

I get "root" in the file /mnt/wls/TST/Errors, while if instead I insert

12 * * * * echo /usr/ucb/whoami | su wls >>/mnt/wls/TST/Errors 2>&1

Then /mnt/wls/TST/Errors  contains "wls".  Can any one tell me what is
going on?  This is on a Vax running 4.2 BSD.  I ran into this when trying
to use rsh to transfer news to another machine.  I am aware that the
whoami manual entry lies, that it uses the real uid rather than the
effective uid.  I don't know in that case whether the man entry or the
code behavior is correct.
-- 
Bill Sebok			Princeton University, Astrophysics
{allegra,akgua,cbosgd,decvax,ihnp4,noao,philabs,princeton,vax135}!astrovax!wls



More information about the Comp.bugs.4bsd.ucb-fixes mailing list