Mailing List Archive

[Bug 950] terminal settings not restored after Ctrl+C during password prompt in scp/sftp
http://bugzilla.mindrot.org/show_bug.cgi?id=950





------- Additional Comments From dtucker@zip.com.au 2005-01-20 22:36 -------
(From update of attachment 738)
Does this need to go to OpenBSD? It doesn't seem to occur on OpenBSD, but I
don't know if it's just because the dice haven't landed right or something with
the tty semantics (or process scheduling?) causes it to not happen.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 950] terminal settings not restored after Ctrl+C during password prompt in scp/sftp [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=950





------- Additional Comments From peak@argo.troja.mff.cuni.cz 2005-01-20 23:35 -------
It appears BSD unlike POSIX/SUS does not revoke access to the controlling
terminal from orphaned processes. This makes the race condition almost
irrelevant on BSD but it does not make it completely irrelevant IMHO.

Consider this scenario (unlikely but possible):
1. scp (the parent) exits
2. ssh (the child) gets SIGINT but blocks for whatever reason (e.g. swapping)
3. the grandparent sees scp has exited and starts a new process
4. the new process turns tty echo off
5. ssh wakes up, turns tty echo on in order to clean up after itself, and exits
6. the new process resumes, unaware echo has been turned on behind its back
(I suspect POSIX demands the revocation of tty access from orphans to make that
impossible.)




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 950] terminal settings not restored after Ctrl+C during password prompt in scp/sftp [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=950


dtucker@zip.com.au changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED




------- Additional Comments From dtucker@zip.com.au 2005-01-24 22:02 -------
The patch has been applied to both OpenBSD and -Portable. Thanks.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.