From owner-freebsd-current@FreeBSD.ORG Mon Jan 21 12:49:23 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ED2C16A419 for ; Mon, 21 Jan 2008 12:49:23 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 6715C13C455 for ; Mon, 21 Jan 2008 12:49:23 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B721E1CD79; Mon, 21 Jan 2008 13:49:22 +0100 (CET) Date: Mon, 21 Jan 2008 13:49:22 +0100 From: Ed Schouten To: FreeBSD Current Message-ID: <20080121124922.GS67081@hoeg.nl> References: <20080121115227.GR67081@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XMM+kVNHGkMezEqK" Content-Disposition: inline In-Reply-To: <20080121115227.GR67081@hoeg.nl> User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: cnclose() doesn't actually call TTY's close routines X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2008 12:49:23 -0000 --XMM+kVNHGkMezEqK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > It isn't a real problem, because nobody runs TIOCSCTTY on /dev/console > and pstat(8) only displays some info in that structure, but it should be > fixed I guess. I'll take a look at this one of these days, but it will > probably be quite hard for me, because I'm not really familiar with the > VFS's design. Ah, I guess I figured it out. It doesn't happen on systems where moused isn't running. moused opens /dev/consolectl on startup and leaves it open during its lifetime. When cnclose() calls vn_close(), it won't run the TTY's close routine because /dev/consolectl is used multiple times. This means that when a TTY is opened by multiple processes (quite common), the session will be unset when all users are gone, not when session itself is being released. This could cause scary things, for example in ttymodem() when a SIGHUP is sent to the session leader. This could be fixed by adding a ttysessrel(), which basically performs a ttyrel(), but also unsets the t_session. I'll take a look at this next month, when I'll be working on FreeBSD full-time. :-) Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --XMM+kVNHGkMezEqK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkeUlNIACgkQ52SDGA2eCwU2PwCeKutXGJowVOoybSWl9VzoFpwm WKIAn1g9ifk8pfyy4CFjpqlLbDs4f58i =YVHG -----END PGP SIGNATURE----- --XMM+kVNHGkMezEqK--