Path: utzoo!attcan!uunet!cs.utexas.edu!know!samsung!usc!elroy.jpl.nasa.gov!ucla-cs!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: loginid vs. uid. Message-ID: <13367@smoke.BRL.MIL> Date: 17 Jul 90 14:11:41 GMT References: <316@dynasys.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 27 In article <316@dynasys.UUCP> jessea@dynasys.UUCP (Jesse W. Asher) writes: >I consider these two separate concepts - one is a name and the other a >number and they are not interchangeable. >My question is does anyone else view them this way, and if not what is >the relationship? The situation is considerably more complex than you described -- The fundamental notion is that of UID; however, the set-UID notion splits UIDness into "real UID" and "effective UID". A process has both, and they may be the same or different. The initial shell provided when you log in has its real UID set according to an entry in /etc/passwd; the only use made of the "login name" is to locate the /etc/passwd entry. However, that name is recorded in /etc/utmp along with the terminal port that was used to connect to the system. Privileged (set-UID root) processes can alter the contents of /etc/utmp, which is usually the source of the login name reported by utilities such as "write". There need not be a name in /etc/utmp for every "terminal" in use, especially in a windowing environment. Other utilities may decide to try to derive a user name by searching for the current real UID in /etc/passwd; however, there may be several passwd entries with the same UID, so the derived user name may not match the one used to log in. The bottom line is that the real UID of a process is well defined, but the "user name" is ill-defined. To fix this would require a massive overhaul of the way that terminals are assigned in UNIX, among other things.