[net.bugs.uucp] USG 5.0 uucp bug - LOGNAME in environment

wescott@ncrcae.UUCP (10/25/83)

The USG 5.0 uucp release has a bug that shows up when one of the
daemons is invoked by cron and su. If uuxqt gets fired up by the
daemon it inherits an environment with null strings in it. This
environment is then inherited by any shells kicked off, which in
turn barf: " : is not an identifier "

The bug is in the setuucp() function in mailst.c. A careful examin-
ation shows that the indentation is not matched by the puctuation.
As written, setuucp has one of two effects depending on whether
LOGNAME=xxx is in the environment already. If so setuucp changes
*all* environment strings to "LOGNAME=xxxx" where xxxx is the name
passed as a parameter.  If LOGNAME is *not* in the environment, every
pointer is changed to point to a null string.

The fix, which has been working here, involves adding braces around
both statements following the if (you could rewrite it to do it right,
whatever way that is).

The if statement is also fouled up, "SAME" should follow == and not be
the subscipt to "envp".

A simple workaround is to change crontab entries to add LOGNAME to the
environment:

30 1 * * * /bin/su uucp -c "LOGNAME=uucp /usr/lib/uucp/uucico -r1 -ssysname"
==========
--Mike Wescott, NCR Corp., Columbia, SC
  decvax!duke!mcnc!ncsu!ncrcae!wescott