Bug 830 - Check immediate EOF coming on stdin
Summary: Check immediate EOF coming on stdin
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 3.8p1
Hardware: Other Other
: P2 minor
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks: 85 V_5_1
  Show dependency treegraph
 
Reported: 2004-04-01 19:20 AEST by Ignasi Roca
Modified: 2008-07-22 12:07 AEST (History)
1 user (show)

See Also:


Attachments
Add check EOF comming on stdin at session_setup time for protocol 2 (3.41 KB, patch)
2004-04-01 19:39 AEST, Ignasi Roca
no flags Details | Diff
Add check EOF comming on stdin at session_setup time for protocol 2 (3.03 KB, patch)
2004-04-01 19:58 AEST, Ignasi Roca
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ignasi Roca 2004-04-01 19:20:16 AEST
Hi,

ssh using protocol 1 checks whether there is an EOF comming on stdin to avoid 
problems on some platforms that select() doesn't wake up when redirected 
from /dev/null. In my case, a POSIX system, this handle is useful and avoids 
also select() complaining agains using /dev/null. So checking EOF comming on 
stdin prevents two possible problems: dont't wake up of select() and select() 
complaining agains using /dev/null.

EOF comes immediate from stdin when using -n option or when stdin is redirected 
to /dev/null (</dev/null).

ssh using protocol 2 doesn't handle EOF comming on stdin then the avobe two 
problems are present.


Cheers,
Ignasi Roca
Fujitsu-Siemens Computers.
Comment 1 Ignasi Roca 2004-04-01 19:39:10 AEST
Created attachment 589 [details]
Add check EOF comming on stdin at session_setup time for protocol 2
Comment 2 Ignasi Roca 2004-04-01 19:55:13 AEST
Comment on attachment 589 [details]
Add check EOF comming on stdin at session_setup time for protocol 2

It is not correct. It fails compiling channels.c
Comment 3 Ignasi Roca 2004-04-01 19:58:43 AEST
Created attachment 590 [details]
Add check EOF comming on stdin at session_setup time for protocol 2
Comment 4 Steve Randlett 2004-09-14 01:00:22 AEST
Hello,
I'm trying to install the patch you created and am having some difficulties.  
I'm patching on a RH8 box using the command "patch <channels.patch"  

I'm getting the error:

-- snip --
(Stripping trailing CRs from patch.)
patching file channels.c
patch: **** malformed patch at line 100:  }
-- snip --

Any idea what I'm doing wrong when applying the patch??
Comment 5 Damien Miller 2005-04-21 18:24:11 AEST
This might be a candidate for portable only, because this select() bug doesn't
seem to exist on OpenBSD.
Comment 6 Damien Miller 2008-05-10 09:56:04 AEST
The fix for bug 85 should help here - ssh/sshd should half-close the channel (and propagate this to the far end) now. Can you retest?
Comment 7 Damien Miller 2008-06-12 08:16:58 AEST
As I mentioned in comment #6, I'm pretty sure that this bug is closed. Please reopen if this is not the case.
Comment 8 Damien Miller 2008-07-22 12:07:00 AEST
Mass update RESOLVED->CLOSED after release of openssh-5.1