forkoff()

Nicolas Williams Nicolas.Williams at ubsw.com
Wed Feb 6 06:45:09 EST 2002


On Mon, Feb 04, 2002 at 10:09:42PM +0100, Markus Friedl wrote:
> i'm not sure this works like expected.

In the context of the -f -f patch it works fine.

Just for kicks I added a ~d escape to call forkoff(1, 1) and indeed, it
DOESN'T WORK as expected. The problem is that SSH2_MSG_CHANNEL_CLOSE is
never sent to close the session, so the session continues to exist and
the remote shell continues to run (idle) while the client sits there in
the background doing nothing. Adding a call to chan_send_oclose2()
would fix that (*) - so does passing SIGHUP :)

(*) Should be safe - I don't see how that could lead to the CLOSE
    message being sent twice. Since the idea is to force a channel
    closed any buffered data should be dropped and the channel
    [io]states set to closed, thus preventing additional close msgs from
    being sent; no EOF msg will be sent thus, but who cares, the CLOSE
    msg suffices.

Nico
-- 
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




More information about the openssh-unix-dev mailing list