From owner-freebsd-current@FreeBSD.ORG Mon Jun 18 20:45:36 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B824016A41F for ; Mon, 18 Jun 2007 20:45:36 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF4E13C4BD for ; Mon, 18 Jun 2007 20:45:36 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 6A3561A4D80; Mon, 18 Jun 2007 13:44:50 -0700 (PDT) Received: from rot13.obsecurity.org (rot13.obsecurity.org [192.168.1.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id 0349E5129D; Mon, 18 Jun 2007 16:45:36 -0400 (EDT) Received: by rot13.obsecurity.org (Postfix, from userid 1001) id E34FBBE89; Mon, 18 Jun 2007 16:45:35 -0400 (EDT) Date: Mon, 18 Jun 2007 16:45:35 -0400 From: Kris Kennaway To: Steve Kargl Message-ID: <20070618204535.GA76759@rot13.obsecurity.org> References: <20070617213948.GA50404@rot13.obsecurity.org> <1182171046.1253.10.camel@localhost> <20070618170520.GA73978@rot13.obsecurity.org> <20070618172048.GA49367@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: <20070618172048.GA49367@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: Tom Evans , current@freebsd.org, Kris Kennaway Subject: Re: Userland problems from kern.pts.enable=1 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, 18 Jun 2007 20:45:36 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 18, 2007 at 10:20:48AM -0700, Steve Kargl wrote: > On Mon, Jun 18, 2007 at 01:05:20PM -0400, Kris Kennaway wrote: > > On Mon, Jun 18, 2007 at 01:50:46PM +0100, Tom Evans wrote: > > > On Sun, 2007-06-17 at 17:39 -0400, Kris Kennaway wrote: > > > > When the kern.pts.enable sysctl is set to '1', pseudo-ttys are crea= ted > > > > with device name /dev/pts/${NUMBER}. With some kernel fixes from k= ib > > > > this appears to now be stable and the kernel side is ready for a > > > > possible change of default. However, the new device naming confuses > > > > some userland utilities. For example: > > > >=20 > > > > pointyhat# write simon > > > > write: /dev/398: No such file or directory > > > >=20 > > > > simon was logged in on /dev/pts/398. > > > >=20 > > > > killall -t also fails to parse the new device format: > > > >=20 > > > > bento# ps -t pts/187 > > > > PID TT STAT TIME COMMAND > > > > 67734 187 Ss 0:00.04 /bin/csh > > > > 72599 187 R+ 0:00.00 ps -t pts/187 > > > > bento# killall -t pts/187 > > > > killall: stat(/dev/ttypts/187): No such file or directory > > > >=20 > > > > It would also be useful if ps -t recognized a numeric argument as > > > > magic and converted it to add the pts/. It already appears to do t= he > > > > converse when displaying the TTY, as you can see above. > > > >=20 > > > > There are probably other utilities also affected. > > > >=20 > > > > Kris > > > >=20 > > >=20 > > > If no-one has already started working on these, I've had a look at a = few > > > of these utils and the changes look quite straightforward. I've been > > > looking for something like this (simple enough for me to do, simple > > > enough that a I can't ??$%^ it up too much) so I can contribute back = to > > > FreeBSD.=20 > > >=20 > > > So far, I'm looking at usr.bin/killall, bin/ps and usr.bin/write > >=20 > > Good news! Thanks for your help. It would be worthwhile also > > auditing for other utilities that manipulate TTYs, for example others > > I can think of off the top of my head are pgrep, watch, etc. > >=20 >=20 > Do the fixes from kib actually permit the use of pts? >=20 > http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/92742 Solves all of my deadlocks/panics. Try it and let us know. Kris --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGdu7vWry0BWjoQKURAiVyAKCjDt+Fh4RrJIbQSysf6tFaQsvcVwCePDhA NtaXv4fXJJmtZtb8hodBO6M= =IGng -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx--