There are actually two environment variables specifying the name of the user:  LOGNAME is supposed to be the name of the real uid, USER is supposed to be the name of the effective uid.

These variables are both subject to forgery, but if we provided both the geteuid and getruid system calls we could discriminate reliably: sometimes you want one, sometimes the other.  This is especially true when one of them is root.  

Scsh calls the syscalls get-uid and get-effective-uid, but I think we should make it get-real-uid instead of get-uid for clarity's sake.

The same applies to gids, of course.

NIS is just a distributed version of /etc/passwd, as DNS is a distributed version of /etc/hosts.  It is tiny and simple compared to X.500.

John Cowan
And now here I was, in a country where a right to say how the country should
be governed was restricted to six persons in each thousand of its population.
For the nine hundred and ninety-four to express dissatisfaction with the
regnant system and propose to change it, would have made the whole six
shudder as one man, it would have been so disloyal, so dishonorable, such
putrid black treason.  --Mark Twain's Connecticut Yankee