Technical article 105024

The command "who am i" returns no data when I have used su(C) to another user.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

I logged into SCO OpenServer Release 5 as the user "user1" and
then executed su(C) to another user, "user2".  However, when I
execute the command "who am i" or "who -m" (see who(C)), this
command returns no value.  In previous versions of SCO UNIX,
"who am i" returned the original login user name, for example:

(Note that "sco_OSr5" refers to an SCO OpenServer 5 system and "sco_OSr3" refers to an SCO Open Desktop 3.0 system.)

Log in as "user1" on the system "sco_OSr5":

sco_OSr5# who am i
user1      ttyp0        Feb 28 07:02
sco_OSr5# su - user2
sco_OSr5# who am i
sco_OSr5#

Log in as "user1" on the system "sco_OSr3":

sco_OSr3# who am i
user1      ttyp0        Feb 28 07:10
sco_OSr3# su - user2
sco_OSr3# who am i
user1      ttyp0        Feb 28 07:10
sco_OSr3#

Cause

The who(C) utility uses the library routine cuserid(S) to obtain the character login name of the user.

In previous versions of SCO UNIX, cuserid(S) returned the original login name of the user.

In SCO OpenServer Release 5, cuserid(S) now returns the current
login name of the user.  This results in the who(C) utility failing
to find a matching utmp(F) entry for this particular user name, and
hence, no value is output.

This change to the library routine cuserid(S) was made to conform to the Posix/XPG4 standard.

Solution

As a workaround, use the program "/bin/who" from SCO UNIX Version 4.x-based operating systems, on SCO OpenServer 5.

This modification in behavior to the who(C) utility has been reported to SCO Engineering and is scheduled to be addressed in a future release of SCO OpenServer 5.

From the Xinuos technical article database, record 105024. Reproduced with permission. The original is at www.sco.com/ta/105024, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.