Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!rutgers!mephisto!prism!gt0178a From: gt0178a@prism.gatech.EDU (BURNS,JIM) Newsgroups: comp.unix.questions Subject: Re: loginid vs. uid. Message-ID: <11461@hydra.gatech.EDU> Date: 17 Jul 90 05:31:29 GMT References: <9007162005.AA11293@mindcrf.mindcraft.com> Organization: Georgia Institute of Technology Lines: 39 in article <9007162005.AA11293@mindcrf.mindcraft.com>, karish@mindcrf.UUCP says: [discussion of what SVID and POSIX do] > > The point of having separate logname() and getuid() functions is > to maintain the login ID and the real UID as separate concepts. The following are man logname excerpts from 1) SunOs 4.0, and 2)AU/X 1.1 (SVR2): 1) DESCRIPTION logname returns the contents of the environment variable LOGNAME, which is set when a user logs into the system. Sun Release 4.0 Last change: 9 September 1987 1 2) man 1 logname says the same thing, while man 3x logname says (in part): DESCRIPTION logname returns a pointer to the null-terminated login name; it extracts the $LOGNAME variable from the user's environ- ment. BUGS This method of determining a login name is subject to for- gery. Interestingly enough, when I do a su - on AU/X, logname and $LOGNAME both report the account I su'd to, whereas under SunOs, $LOGNAME reports the account I su'd to, and logname returns the account I su'd from, in contradiction to its man page. (My .profile and the system's /local/etc/profile don't do anything strange to $LOGNAME.) Sequent Dynix apparently doesn't support logname. -- BURNS,JIM Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a Internet: gt0178a@prism.gatech.edu