[gnu.emacs.bug] bug in GNU emacs

klein.muc@UUNET.UU.NET (10/05/89)

a minor bug is integrated in our version 18.51 of GNU emacs:
When getting a shell and invoking "who am i" nothing happens.
The who command itself works fine, but "who am i" fails.
I would be glad to get an answer. Gottfried Klein (Munich)

kamat@uceng.UC.EDU (Govind N. Kamat) (10/05/89)

In article <8910051019.AL27323@unido.informatik.uni-dortmund.de> unido!nixpbe!klein.muc@UUNET.UU.NET writes:

   a minor bug is integrated in our version 18.51 of GNU emacs:
   When getting a shell and invoking "who am i" nothing happens.
   The who command itself works fine, but "who am i" fails.
   I would be glad to get an answer. Gottfried Klein (Munich)

That's not a bug in Emacs.  The command "who am i" relies on its
process to be attached to a terminal to discover who you are.  The
processes Emacs spawns are in their own process groups, and not
attached to terminals.

You should be able to use "whoami" successfully, or, if you don't have
that, "logname".  The former returns the username corresponding to the
real uid of the process, and the latter does so if its process is not
attached to a terminal.

--
Govind N. Kamat 			College of Engineering
kamat@uceng.UC.EDU			University of Cincinnati
					Cincinnati, OH 45221, USA

tale@pawl.rpi.edu (David C Lawrence) (10/06/89)

[More UUCP bouncing.  IcK.]

In <8910051019.AL27323@unido.informatik.uni-dortmund.de> Gottfried Klein
<unido!nixpbe!klein.muc@UUNET.UU.NET> writes:
GK> a minor bug is integrated in our version 18.51 of GNU emacs:
GK> When getting a shell and invoking "who am i" nothing happens.

It isn't precisely a bug with Emacs.  "who am i" uses the getlogin()
routine which has some limitations:

     getlogin() does not work for processes running under  a  pty
     (for  example,  emacs  shell buffers, or shell tools) unless
     the program ``fakes'' the login name in the /etc/utmp file.
     [From the SunOS 4.0.3 manual page for getlogin()]

You may have observed similar problems with ftp in a shell buffer.
The ftp code can come up with "nobody" as the default login name
because the getlogin() call fails but no attempt is made to then get
the name of the process owner ( getpwuid(getuid())->pw_name, for
example ).  This apparently has changed in recent SunOS releases, at
least, because I just tried it and it worked fine.

It could be argued, though not in this forum, that Emacs should
attempt to fake the /etc/utmp entry.

Dave
--
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))