From owner-freebsd-current@FreeBSD.ORG Tue Sep 26 18:13:24 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89D6916A403 for ; Tue, 26 Sep 2006 18:13:24 +0000 (UTC) (envelope-from allbery@ece.cmu.edu) Received: from bache.ece.cmu.edu (BACHE.ECE.CMU.EDU [128.2.129.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24C1A43D49 for ; Tue, 26 Sep 2006 18:13:24 +0000 (GMT) (envelope-from allbery@ece.cmu.edu) Received: by bache.ece.cmu.edu (Postfix, from userid 953) id 6BB4FA5; Tue, 26 Sep 2006 14:13:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on filt2.ece.cmu.edu X-Spam-Level: * X-Spam-Status: No, score=1.0 required=6.0 tests=BAYES_60 autolearn=no version=3.1.4 Received: from [10.9.204.128] (dsl093-061-215.pit1.dsl.speakeasy.net [66.93.61.215]) by bache.ece.cmu.edu (Postfix) with ESMTP id 46CA69E; Tue, 26 Sep 2006 14:13:21 -0400 (EDT) In-Reply-To: <4f674ca50609261109s78a26d3dh1dd0a6dc8c112ca2@mail.google.com> References: <20060926111452.J91466@godot.imp.ch> <0C4B0125-11AA-4BDB-A4E3-163A6194AB68@alumni.cwru.edu> <98FD6058-7220-48DB-AC24-F989FCB2AE11@ece.cmu.edu> <4f674ca50609261029s76432971yfc15171a3e89cb72@mail.google.com> <8EECEF0C-8C94-4A7C-862A-633F67D3D229@ece.cmu.edu> <4f674ca50609261109s78a26d3dh1dd0a6dc8c112ca2@mail.google.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: "Brandon S. Allbery KF8NH" Date: Tue, 26 Sep 2006 14:13:18 -0400 To: "Magnus Ringman" X-Mailer: Apple Mail (2.752.2) Cc: current@freebsd.org Subject: Re: What do you think ?: How should pseundo terminals behave ... 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: Tue, 26 Sep 2006 18:13:24 -0000 On Sep 26, 2006, at 14:09 , Magnus Ringman wrote: > On 9/26/06, Brandon S. Allbery KF8NH wrote: >> I think that in many circumstances (and, as you note, implemented in >> other OSes), the correct behavior *is* to treat hangup as "backing >> device no longer exists" --- an older session should not leak into a >> newer one, it is a potential security hole and certainly a potential >> source of confusion. And if hardware ttys do it, I should think >> virtual ones should also do so for consistency. > > Methinks Sir has it the wrong way around! > Hangup on a hardware device -doesn't- void a program's access to the > device. It just (optionally) sends the process a SIGHUP. That is why > somebody (iirc, for SunOS < 5) invented vhangup(2) as a means for a > new session owner to insure it was the only process using the > terminal. I think you misunderstood: yes, physically you do not lose access, but for security reasons *logically you should*, and that is why vhangup() was invented. And, this being done, it is also a reasonable --- and, more to the point, consistent --- model for what happens when a pty slave loses its master (which *is* equivalent to physically losing access). -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH