Technical article 110547

SCOadmin Reports Manager utility on OpenServer 5 truncates year information.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

The SCOadmin Reports Manager utility, a tool for monitoring system security on the basis of user accounts, passwords, logins, and terminal access, does not report year information completely on the SCO OpenServer 5 releases listed above.

Specifically, a problem exists in displaying the year information for system dates of January 1, 2000 and beyond within the output of the "Terminal Login Status" report.

This particular report is generated by opening the System Administration folder on the OpenServer 5 desktop, and then choosing System -> Security -> Reports Manager; alternatively, you can type "scoadmin reports" from the command line.

At this point, choosing Reports -> Terminal Login Status, will generate output similar to the following when login or logout times occur within the year 2000 and beyond:

  Login Activity Report
     System  SCO_SV
Fri Oct  6 10:56:32 2000
           Last Good Login     Last Bad Login      Last Logout
Tty Name User Name Date     User Name Date     User Name Date     #Failed
--- ---- ---- ---- ----     ---- ---- ----     ---- ---- ----     -------
console  UNKNOWN   NEVER    UNKNOWN   NEVER    UNKNOWN   NEVER    0
tty01    root      09/01/99 root      08/05/99 root      09/01/99 0
tty02    root      09/02/99 UNKNOWN   05/26/99 UNKNOWN   NEVER    0
tty03    root      10/06/200root      09/27/99 root      10/06/99 0
Here, we have just reported the terminal login status of
a few ttys.  The "Last Good Login" on tty03 has occurred on
October 6, 2000.  The Reports Manager attempts to print out
both century and year information, but the last digit gets
truncated.  Thus, it is impossible to distinguish among the
individual years within any decade in the 21st century.
Login/logout dates before January 1, 2000 are displayed with
two-digit years correctly and consistently.

Solution

This problem is fixed in SCO OpenServer Release 5.0.6.

To work around this problem for earlier releases, take the following steps:

As root, cut and paste the two shell scripts below into the files:

/local/bin/termlogin.report
/local/bin/cvtstring

(Create /local/bin if it does not exist already.)

Make these files only executable by root:

cd /local/bin
chmod 700 termlogin.report cvtstring

To execute the report, make sure that /local/bin is in your path:

PATH=$PATH:/local/bin;export PATH
and simply enter the command:
termlogin.report

to write the report to standard output.

#####cut here and save script below into /local/bin/termlogin.report########
#!/bin/sh
sed 's/#/=/g' /etc/auth/system/ttys > /tmp/ttys#
line=
export line
for i in `cat /tmp/ttys#`
do
    line=$line$i
    if echo $i | grep "chkent:$" 2>&1 >/dev/null
    then
      echo $line >> /tmp/ttys.tmp
      line=
    fi
done
rm /tmp/ttys#
echo "                                Login Activity Report"
echo "                                   System  `uname -n`"
echo "                              `date`"
echo "         Last Good Login      Last Bad Login       Last Logout"
echo "Tty Name User Name Date       User Name Date       User Name Date
#Failed"
echo "--- ---- ---- ---- ----       ---- ---- ----       ---- ---- ---- -------"
for i in `cat /tmp/ttys.tmp`
do
     echo $i | awk 'BEGIN { RS=":"; FS="="
                            devname = "UNKNOWN"
                            uid = "UNKNOWN"
                            logtime = "NEVER"
                            unsucuid = "UNKNOWN"
                            unsuctime = "NEVER"
                            prevuid = "UNKNOWN"
                            prevtime = "NEVER"
                            failures = "0" }
        $1 ~ /t_devname/ { devname = $2 }
        $1 ~ /t_uid/ { uid = $2 }
        $1 ~ /t_logtime/ { "/local/bin/cvtstring " $2 | getline logtime
                           logtime = substr(logtime,1,10) }
        $1 ~ /t_unsucuid/ { unsucuid = $2 }
        $1 ~ /t_unsuctime/ { "/local/bin/cvtstring " $2 | getline unsuctime
                           unsuctime = substr(unsuctime,1,10) }
        $1 ~ /t_prevuid/ { prevuid = $2 }
        $1 ~ /t_prevtime/ { "/local/bin/cvtstring " $2 | getline prevtime
                           prevtime = substr(prevtime,1,10) }
        $1 ~ /t_failures/ { failures = $2 }
                END { printf "%-8s %-9s %-10s %-9s %-10s %-9s %-10s %-8s\n",
                      devname,uid,logtime,unsucuid,unsuctime,prevuid,prevtime,
                      failures }'
done
rm /tmp/ttys.tmp
################end of script /local/bin/termlogin.report############
#####cut here and save script below into /local/bin/cvtstring########
#!/bin/tcl
set arg1 [lindex $argv 0]
set result [fmtclock $arg1 %m/%d/%Y]
puts $result
################end of script /local/bin/cvtstring###################

See also

ta110548, "SCOadmin Reports Manager utility on UnixWare 7 truncates year information."

From the Xinuos technical article database, record 110547. Reproduced with permission. The original is at www.sco.com/ta/110547, which is reachable but blocked from search engines.

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.