Bug 2719

Summary: Notify user, when ssh transport process dies.
Product: Portable OpenSSH Reporter: Tomas Kuthan <tomas.kuthan>
Component: sftpAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: minor CC: djm, dtucker, tomas.kuthan
Priority: P5    
Version: 7.5p1   
Hardware: SPARC   
OS: Solaris   
Bug Depends on:    
Bug Blocks: 2852    
Attachments:
Description Flags
Notify user, when ssh transport process dies
none
slightly tweaked dtucker: ok+

Description Tomas Kuthan 2017-05-22 23:15:49 AEST
When ssh transport process dies (e.g. if remote side hangs up), the user
does not learn about it,  until they try to execute the next remote
command.

The sftp process has this information available; it would be prudent to let the user know.
Comment 1 Tomas Kuthan 2017-05-22 23:18:41 AEST
Created attachment 2982 [details]
Notify user, when ssh transport process dies
Comment 2 Tomas Kuthan 2017-05-22 23:24:41 AEST
Alternatively, sftp process could just quit, when the underlying ssh process goes away. There is very little it can do anyway.
Comment 3 Tomas Kuthan 2017-05-22 23:26:02 AEST
If #2718 is implemented, this issue gets more visible.
Comment 4 Damien Miller 2017-06-23 13:45:45 AEST
I think the patch as it stands will break the '!' shell-out command. That's easy enough to fix local_do_shell() to reset the signal handler for it's business.

I wonder if there's some nicer way of informing though, but it seems tricky with libedit in the way...
Comment 5 Tomas Kuthan 2017-06-24 02:07:20 AEST
Hi Damien,

Thanks for looking at the patch.

I don't think it is harmful for '!' commands. The SIGCHLD handler doesn't do anything, if the departed child was not the transport ssh process. Reseting the handler would not be wrong, but I don't think it is necessary. 

Thanks,
Tomas
Comment 6 Damien Miller 2017-06-30 13:39:48 AEST
Created attachment 3002 [details]
slightly tweaked

A couple of small tweaks to the original diff:

Made it apply cleanly (your tree seems to have some additional signal() calls)

WNOWAIT doesn't seem to be POSIX and certainly isn't available on BSD

move a comment.
Comment 7 Damien Miller 2018-04-06 13:12:20 AEST
Move to OpenSSH 7.8 tracking bug
Comment 8 Damien Miller 2018-05-11 13:40:33 AEST
This was committed a few weeks back. It will be in the OpenSSH 7.8 release.
Comment 9 Damien Miller 2021-04-23 15:02:30 AEST
closing resolved bugs as of 8.6p1 release