What do you think ?: How should pseundo terminals behave ...
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Tue Sep 26 11:13:24 PDT 2006
On Sep 26, 2006, at 14:09 , Magnus Ringman wrote:
> On 9/26/06, Brandon S. Allbery KF8NH <allbery at ece.cmu.edu> 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 at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
More information about the freebsd-current
mailing list