| Summary: | heredoc lines get consumed by previous statement | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Renaud Métrich <rmetrich> |
| Component: | sshd | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | CLOSED WORKSFORME | ||
| Severity: | normal | CC: | djm, tylercashea33 |
| Priority: | P5 | ||
| Version: | 8.0p1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
|
Description
Renaud Métrich
2022-06-17 19:25:38 AEST
AFAIK it's the shell that is getting confused. ssh is propagating the stdin close correctly from the client: > debug2: PTY allocation request accepted on channel 0 > debug2: channel 0: rcvd adjust 2097152 > debug3: receive packet: type 99 > debug2: channel_input_status_confirm: type 99 id 0 > debug2: shell request accepted on channel 0 > debug2: channel 0: read<=0 rfd 4 len 0: closed > debug2: channel 0: read failed > debug2: chan_shutdown_read: channel 0: (i0 o0 sock -1 wfd 4 efd 6 [write]) to the server: > Starting session: shell on pts/7 for djm from 127.0.0.1 port 37500 id 0 > debug2: fd 3 setting TCP_NODELAY > debug3: set_sock_tos: set socket 3 IP_TOS 0x48 > debug2: channel 0: rfd 8 isatty > debug2: fd 8 setting O_NONBLOCK > debug3: fd 6 is O_NONBLOCK > debug3: send packet: type 99 > debug1: Setting controlling tty using TIOCSCTTY. > debug3: receive packet: type 96 > debug2: channel 0: rcvd eof > debug2: channel 0: output open -> drain > debug2: channel 0: obuf empty > debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 6 efd -1 [closed]) > debug2: channel 0: output drain -> closed It's possible that bash/zsh is getting confused by its stdin being nonblock, but there isn't much that ssh/sshd can do about that without reintroducing bug #3280 It does seem to behave better when a PTY is not requested (i.e. remove the -t flags) OpenSSH 9.3 has been released. Close resolved bugs |