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 0Here, 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 cvtstringTo execute the report, make sure that /local/bin is in your path:
PATH=$PATH:/local/bin;export PATHand simply enter the command:termlogin.reportto write the report to standard output.
#####cut here and save script below into /local/bin/termlogin.report#########!/bin/shsed '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
donerm /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 }'donerm /tmp/ttys.tmp################end of script /local/bin/termlogin.report#################cut here and save script below into /local/bin/cvtstring#########!/bin/tclset 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."