Technical article 105091

su(C) logs incorrect entry to /usr/adm/sulog.

OpenServer 5.0.0OpenServer 5.0.2

Written · Last revised

Problem

When a user named "test" uses the /bin/su utility to switch
to another user named "fred", an incorrect entry is logged
to the file /usr/adm/sulog.  This entry should contain the
"switched from" and "switched to" users in the form (for this
example) "test-fred", but instead it appears as "root-fred".

Cause

su(C) utilizes a function which returns the effective user id
(euid) instead of the real (ruid) of the caller, and writes
this result to /usr/adm/sulog.  Since su(C) is a setuid binary
owned by root, the caller's euid is 0 (root), that is, su is
run with an euid of 0.  Thus, a typical entry for the example
above looks like:
SU 02/07 14:11 + ttyp1 root-fred
instead of the correct:
SU 02/07 14:11 + ttyp1 test-fred

Solution

SCO has created a new /bin/su binary which writes the ruid
to /usr/adm/sulog instead of the euid, and gives the expected
result.  This binary is available upon request from SCO Support
Services.  Please follow the steps below to properly install
the new binary, assuming that the binary is initially present
on the system as /tmp/su, and that the operating system platform
is SCO OpenServer Release 5.0.0.  The same procedure applies to
OpenServer Release 5.0.2, except that all references to "5.0.0Cl"
(the version number of the Unix component) should be changed to
"5.0.2Dp".  In addition, the line in RTS.fl referred to in step 7
below will have different original size and checksum information.

1. As root, cd to the directory containing the original su binary:

cd /opt/K/SCO/Unix/5.0.0Cl/bin

2. Move the original su binary to another "safe" directory, preferably a directory not accessible by any user other than root.

3. Move /tmp/su to the directory noted in step 1.

4. Change the modes on su (if they aren't set to the values below):

cd /opt/K/SCO/Unix/5.0.0Cl/bin
chmod 6111 su
chgrp auth su

The command "l su" should now yield (except possibly for the date):

---s--s--x   1 root     auth        56264 May 16 14:54 su

5. Perform a checksum of the su binary:

sum -lr su
This should yield:
3470369663    110 su
6. Change to the /opt/K/SCO/Unix/5.0.0Cl/.softmgmt directory:
cd ../.softmgmt

7. Find this line in the file RTS.fl:

RTS.fl:FILE 06111 root auth 1 40552 1950468205 I - - 0 0 ./bin/su

8. Modify both the size and checksum in this line (as given in step 4 and 5 above), so that it reads:

RTS.fl:FILE 06111 root auth 1 56264 3470369663 I - - 0 0 ./bin/su

9. Save the changes to RTS.fl
NOTE:     If you move the original su binary back, the above steps should
          be repeated, this time for the original binary instead of the new
          one.

See also

See the su(C) man pages, for a discussion of how to specify an alternate log file (default is /usr/adm/sulog), and for a description of the types of information found in the sulog entries.

From the Xinuos technical article database, record 105091. Reproduced with permission. The original is at www.sco.com/ta/105091, 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.