Path: utzoo!utgpu!watmath!jmsellens
From: jmsellens@watmath.waterloo.edu
Newsgroups: uw.mfcf.bugs
Subject: batch refuses to run if USER is empty, fails in SunOS cron
Message-ID: <29343@watmath.waterloo.edu>
Date: 24 Sep 89 06:17:59 GMT
Sender: jmsellens@watmath.waterloo.edu
Reply-To: jmsellens@watmath.waterloo.edu
Distribution: uw
Lines: 17

From: John M Sellens 

SunOS cron seems to run with USER set to the empty string, so batch
refuses to any jobs.  It should probably do getpwuid(0) if the getpwnam()
fails and send mail to the0 userid.

	/*
	 * Set up a $USER mailuserid for ROOT if one isn't given.
	 */
	if( uid == 0 && mailuserid == NULL
	  && (mailuserid = getenv("USER")) != NULL ){
		if( getpwnam(mailuserid) == NULL ){
			error1("Can't find $USER='%s' in passwd file\n",
				mailuserid);
			cleanup(0);
		}
	}