Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2001 03:00:01 -0700 (PDT)
From:      Yar Tikhiy <yar@snark.rinet.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/15478: incorrect utmp/wtmp records update upon connection being interrupted
Message-ID:  <200110161000.f9GA01o86886@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/15478; it has been noted by GNATS.

From: Yar Tikhiy <yar@snark.rinet.ru>
To: Igor Roshchin <str@giganda.komkon.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/15478: incorrect utmp/wtmp records update upon connection being interrupted
Date: Tue, 16 Oct 2001 13:52:37 +0400

 On Mon, Oct 15, 2001 at 03:06:15PM -0400, Igor Roshchin wrote:
 > 
 > > > Although I see your point, at this moment I am not convinced that this an
 > > > application-only problem. I believe the system should be able to correct 
 > > > both utmp and wtmp. Thus, I don't think this PR should be closed without
 > > > a proper fix.
 > >
 > > I don't see a clear way of fixing the wtmp file in such a case.
 > > Additionally, I believe an operating system cannot have a tool/code
 > > to fix every breakage that a lame program run with the superuser rights
 > > may introduce.
 > 
 > In my previous response I suggested what init can do about it.
 > You are coming from the position "in the current design of the system
 > it can not be done". So, sometimes the design of the system can/should
 > be changed.
 > 
 > Again, let me reiterate my suggestion:
 > When the init regains control of the tty, it should 
 > 1. lookup what is going on with the record corresponding to that tty in
 > wtmp. 
 > 2. If that record does not have the corresponding "closing record",
 > check for the existence of the utmp record 
 >  a) if present - "move" it to the wtmp
 >  b) if absent - write the "closing record" to wtmp using the current time
 > stamp.
 > 
 > This way the system can insure that no matter what application
 > has left a trace behind it, the wtmp and utmp files are coherent.
 
 Sorry, but I see at least two drawbacks in such a solution:
 
 1. Nowadays few tty sessions are started and closed by init(8).
    Much more often it's sshd, or telnetd, or some sort of XDM
    that manages sessions and the utmp and wtmp files.  That leads
    to the need of fixing all such applications, which are mostly
    third-party software.
 
 2. Since the wtmp file is a log file, each "lookup" will mean
    scanning it sequentially, which will lead to excessive resource
    use and the possibility of DoS attacks if wtmp is large.
 
 -- 
 Yar

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110161000.f9GA01o86886>