| Summary: | Connection stalls on PTY allocation failure | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Alex Beregszaszi <alex> | ||||||
| Component: | sshd | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | normal | CC: | djm, dtucker | ||||||
| Priority: | P2 | ||||||||
| Version: | 5.3p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | All | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 1708 | ||||||||
| Attachments: |
|
||||||||
|
Description
Alex Beregszaszi
2010-01-15 01:43:53 AEDT
I think it's a bug in the client failing to handle the pty allocation failure. I looked at this once before but at the time the code made if very difficult to associate the failure message with the pty request. We've improved it since then so it might be time to take another look. You can't just disconnect. A single sshd can have multiple sessions and thus multiple ptys, so the failure to allocate one should not cause the connection to terminate. If you say this must be handled on the client part, then maybe in clientloop.c:client_session2_setup() the do_close parameter might be changed to 1 in client_expect_confirm(id, "PTY allocation", 0); inside the want_tty if branch. Looks like that will terminate only that channel. Also notice the comment there: XXX wait for reply yes, the reply callback infrastructure is quite new and not everything uses it yet Created attachment 1830 [details]
kill-on-pty-fail.diff
Kill channel on PTY allocation failure
Created attachment 1831 [details]
kill-on-pty-fail2.diff
Kill channel on PTY allocation failure
patch applied - will be in OpenSSH 5.6p1 Move resolved bugs to CLOSED after 5.7 release |