utmp woes under Solaris 2.3

utmp woes under Solaris 2.3

Post by Stuart McD » Thu, 27 Jan 1994 01:19:42



Forgive me if this has already been talked about a million times.

It seems that under 2.3 (I don't know about 2.2) that the
/var/adm/utmp file has _completely_ erroneous information in it.

For instance:

Quote:>w | grep "pts\/1"

smcdow   pts/1         7:59am       6839:12 3330:16  
debbiek  pts/1         9:40am            8      1  more ChangeLog

Wow!! Two people logged in to the same to the same tty!!!! Neat-O!!!

I called Sun about it, and they gave me the party line: something to
the effect of abnormally terminated shells will leave its skin in the
utmp file. And they weren't going to do anything about it.

What the hell? I mean really!

Any guidance/info/complaints/flames?

Thanks.

--

| Applied Research Laboratories          |          +1 512 835 3672 w          |
| The University of Texas at Austin      |                                     |
| 10000 Burnet Rd., Austin, Texas 78758  |                                     |

 
 
 

utmp woes under Solaris 2.3

Post by Gregory Ow » Thu, 27 Jan 1994 07:17:10



> It seems that under 2.3 (I don't know about 2.2) that the
> /var/adm/utmp file has _completely_ erroneous information in it.
...
> I called Sun about it, and they gave me the party line: something to
> the effect of abnormally terminated shells will leave its skin in the
> utmp file. And they weren't going to do anything about it.

        ...sure.  abnormally terminated shells that didn't do so in
2.2.  And sun wonders why its getting a bad name....


 1.01 GCS/GO d++ p+ c++ l++ u++ e+ -m+ s++/- n- h !(f)? g+ -w+ t+ r-- y?
"Put the staff in my hands; for I go to the Fenians, O cleric, to chaunt/
The war-songs that roused them of old; they will rise, making clouds..."

 
 
 

utmp woes under Solaris 2.3

Post by Jay Berkenbi » Thu, 27 Jan 1994 03:33:50


I have seen the problem of bogus (usually old) utmp entries
being left around in Solaris 2.3 as well.  It did not happen
under Solaris 2.2.  I haven't investigated further.  This can be
a serious problem, not just an annoyance.  Unlike other utmp
problems I've seen in other operating systems in the past, if
you rlogin to a machine and happen to get a tty that someone
else already has an entry for, "who" will say that they are
logged in.  If you try to su to fix the problem, su won't let
you because your uid and your utmp entry don't match
(presumably).  You can just keep creating new ttys until you get
a fresh one and then clean up manually in this case.

I have not investigated this to see whether a patch exists.  I
didn't see one in Sunsolve 2.1.1.  I just got 2.1.2 today and
haven't installed it yet.
--

                                Engineering Research Associates

 
 
 

utmp woes under Solaris 2.3

Post by John Caru » Fri, 28 Jan 1994 05:23:58



>It seems that under 2.3 (I don't know about 2.2) that the
>/var/adm/utmp file has _completely_ erroneous information in it.

>I called Sun about it, and they gave me the party line: something to
>the effect of abnormally terminated shells will leave its skin in the
>utmp file. And they weren't going to do anything about it.

>Any guidance/info/complaints/flames?

Yes--whoever told you this at Sun has no idea what they're talking
about.  Every day when I leave I exit Openwindows, including *normally*
terminating my various shelltools...yet after I'm out of OW and signed
off the system there are still 5-6 of me left behind.  I collect 5 or
6 more every day, but they appear to go away by themselves after 3 days
or so.  The result is that w/who always show about ten of me whether
whether I'm actually logged on or not.  I haven't had a chance to place
a call about it yet.

And this never happened under Solaris 2.2.  It began as soon as I
upgraded my LX to 2.3 (and it's one of the main reasons I won't be
upgrading our 1000 to 2.3, at least not until I'm confident that bugs
like this have been worked out).

---------------------------------------------------------------------


 University of Maryland University College      Work: (301) 985-7447
---------------------------------------------------------------------

 
 
 

utmp woes under Solaris 2.3

Post by Bill Wisn » Fri, 28 Jan 1994 16:14:11


There are two things going on:

(1) xterm in Solaris 2.3 does not properly remove its entries from
utmp when it exits.

(2) there is apparently a bug in telnetd that causes it to occasionally
exit uncleanly and consequently not remove the user's entry from utmp.
I am currently trying to convince Sun support that this is indeed a problem
and get a fix (on our machine with at least a thousand logins daily, it
definitely shows up!).  If anyone else is having this particular problem
contact me and I'll tell you what bug ID to reference to add your voice
to mine.
--

 
 
 

utmp woes under Solaris 2.3

Post by Casper H.S. D » Fri, 28 Jan 1994 17:38:51



>Yes--whoever told you this at Sun has no idea what they're talking
>about.  Every day when I leave I exit Openwindows, including *normally*
>terminating my various shelltools...yet after I'm out of OW and signed
>off the system there are still 5-6 of me left behind.  I collect 5 or
>6 more every day, but they appear to go away by themselves after 3 days
>or so.  The result is that w/who always show about ten of me whether
>whether I'm actually logged on or not.  I haven't had a chance to place
>a call about it yet.
>And this never happened under Solaris 2.2.  It began as soon as I
>upgraded my LX to 2.3 (and it's one of the main reasons I won't be
>upgrading our 1000 to 2.3, at least not until I'm confident that bugs
>like this have been worked out).

In Solaris 2.2, user processes where not allowed to write to /etc/utmp*.
In Solaris 2.3, a set-uid executable called ``/usr/lib/utmp_update''
was introduced that is called by the standard C library *ut* functions.
What basically happens is that in Solaris 2.2, shelltool, cmdtool and xterm
didn't update utmp and friend.  So they couldn't mess up your
/etc/utmp* files.  In 2.3, they suddenly can update those files and
it turns out the programs were broken all along.

Casper

 
 
 

utmp woes under Solaris 2.3

Post by Ian Donalds » Fri, 28 Jan 1994 19:59:46




>> It seems that under 2.3 (I don't know about 2.2) that the
>> /var/adm/utmp file has _completely_ erroneous information in it.
>...
>> I called Sun about it, and they gave me the party line: something to
>> the effect of abnormally terminated shells will leave its skin in the
>> utmp file. And they weren't going to do anything about it.
>    ...sure.  abnormally terminated shells that didn't do so in
>2.2.  And sun wonders why its getting a bad name....

Solaris 2.3 /usr/openwin/bin/xterm leaves bogus utmp entries *every time*
somebody types "exit" to a shell (ksh/sh/csh, take your pick)!    
I don't consider that abnormal termination!

They sit there with huge idle times, at least as a clue (I think
the pty driver resets the access time to the boot time or something upon
last close; something that SunOS 4 does too)

Ian D

 
 
 

utmp woes under Solaris 2.3

Post by Larry W. Vird » Sun, 30 Jan 1994 01:38:35


I have a similar problem that I would like to discuss.  I am porting some
code from SunOS 4.1 that reads utmp and looks at the host name entry.
But that is gone from Solaris 2.3's /etc/utmp - it is described in utmpx
as being there though.

Fine, so I can #ifdef some code that uses utmpx or utmp depending on
what system I am using.  Except that this code does not seem to work
correctly.  I am looking for some Solaris hackers to point me to the
stupid thing I am doing.  Note that my /etc/utmp and /etc/utmpx are
both 644 permissions.  When I run the following, I get perror() telling
me Permission denied, with a NULL from getutxline().

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <utmpx.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>

struct utmpx    u;

int main()
{

        char * ptr;

        ptr = ttyname(0);

        fprintf(stderr, "Tty is %s\n", ptr);

        strcpy(u.ut_line, ptr);

        errno = 0;
        if (getutxline(&u) == NULL)
        {
           perror("terwait");
           fprintf( stderr, "terwait:  Cannot open /etc/utmp.\n" );
           return( 1 );
        }
        return 0;

Quote:}

--
:s Great net resources sought...

:s Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
The task of an educator should be to irrigate the desert not clear the forest.
 
 
 

utmp woes under Solaris 2.3

Post by Larry W. Vird » Wed, 02 Feb 1994 00:42:28


Well, after some kind assistance from one of the folks reading this group
(Thanks Mr. Davis!)

I was able to find a work around.  It turns out that getutxline wants the
"subdirectory name" of the device.  Ttyname returns the full path name.
So when ttyname returns /dev/pts/0, you have to strip off the /dev/ before
putting the pts/0 into the field for getutxline.   This form appears to be
used in the other utmpx routines as well - so if you are doing strcmp(), etc.
you must account for that as well.
--
:s Great net resources sought...

:s Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
The task of an educator should be to irrigate the desert not clear the forest.

 
 
 

utmp woes under Solaris 2.3

Post by Jonathan Min » Thu, 03 Feb 1994 04:25:12



>It seems that under 2.3 (I don't know about 2.2) that the
>/var/adm/utmp file has _completely_ erroneous information in it.

>Wow!! Two people logged in to the same to the same tty!!!! Neat-O!!!
>What the hell? I mean really!

I've seen the same problems.  Yesterdat I had a user who couldn't use
passwd to change his password.  It kept saying "changing password for
user root, permission denied", it turned out that root was also logged
into that tty.  What do you guys at SUN say to this?

Jon
--
| Jonathan Miner                       | Run Linux, model the

| 603-885-2438 <voice> 1480 <fax>      | And always ski downhill...
#include <std/disclaimer.h>

 
 
 

utmp woes under Solaris 2.3

Post by William L. Jone » Sat, 19 Mar 1994 23:23:54




>>It seems that under 2.3 (I don't know about 2.2) that the
>>/var/adm/utmp file has _completely_ erroneous information in it.

>>Wow!! Two people logged in to the same to the same tty!!!! Neat-O!!!
>>What the hell? I mean really!

>I've seen the same problems.  Yesterdat I had a user who couldn't use
>passwd to change his password.  It kept saying "changing password for
>user root, permission denied", it turned out that root was also logged
>into that tty.  What do you guys at SUN say to this?

>Jon
>--
>| Jonathan Miner                       | Run Linux, model the

>| 603-885-2438 <voice> 1480 <fax>      | And always ski downhill...
>#include <std/disclaimer.h>

You might try the utmpd on ftp.chpc.utexas.edu in packages/suno5.

Bill Jones

 
 
 

utmp woes under Solaris 2.3

Post by John Caru » Sun, 20 Mar 1994 02:20:59



>I've seen the same problems.  Yesterdat I had a user who couldn't use
>passwd to change his password.  It kept saying "changing password for
>user root, permission denied", it turned out that root was also logged
>into that tty.  What do you guys at SUN say to this?

For even more fun, try using talk from the user on the duplicated tty.
The talk request will come in from the original user of the tty.  And
actually I've found that it relies on who shows up first in utmpx--if
you're before the "ghost" entry, you're the owner, otherwise the ghost
is the owner.  It appears to be a problem with the cuserid() library
call which performs a search of utmpx using your tty as the search
criteria.

I have a call open with Sun and they sent me two patches: T101615-01
and 101533-02.  The first is for the utmp problems, the second is
for xterm.  This did fix the problem with xterm producing ghosts, but
we're still getting ghosts from other sessions (only under Openwindows,
I should add).

---------------------------------------------------------------------


 University of Maryland University College      (301) 985-7447
---------------------------------------------------------------------

 
 
 

1. SOLARIS 2.3: Looking for program to clean utmp

I am looking for the programs/[perl]scripts that can clean utmp for Solaris 2.3.
For some reasons, userid(s) is still there even the user has logout.
I am planning to run this program periodically.

Also I am looking for admin stuff, e.g. program that can trim
adm/wtmpx, various log files, messages, etc.

Sorry if this topic has been beaten to death.
E-mail reply is preffered, but posting is also okay.
Thanks.

-- budi
--
Budi Rahardjo

Electrical Engineering - University of Manitoba - Canada

2. DOOM CRASHED MY MACHINE!!!!!

3. utmp & wtmp problems in Solaris 2.3 - HELP!

4. Please explain PS1='\h:\w\$ '

5. UTMP problem with Solaris 2.3 & tcsh.

6. Performance Tuning a SPARC/Solaris combination

7. utmp/wtmp problems in Solaris 2.3

8. Looking Glass

9. HELP: Solaris 2.3 <---> Solaris 2.3 PPP link problems

10. HELP: Solaris 2.3 <---> Solaris 2.3 PPP link Problems

11. Solaris 2.3 disk space woes

12. Exabyte 8500C woes in SOlaris 2.3

13. Solaris 2.3/PPP Woes