strange behaviour with ssh / stdin

Roumen Petrov openssh at roumenpetrov.info
Thu Oct 16 01:46:28 EST 2003


  USE_PIPES is not solution ;-)
===========================================================
echo hello | ssh localhost 'ls -l /dev/fd/; cat /dev/fd/0; zsh -c "ls -l 
/dev/fd/"'
total 0
lr-x------    1 rumen2   rumen          64 Oct 15 18:07 0 -> pipe:[12554]
l-wx------    1 rumen2   rumen          64 Oct 15 18:07 1 -> pipe:[12555]
l-wx------    1 rumen2   rumen          64 Oct 15 18:07 2 -> pipe:[12556]
lr-x------    1 rumen2   rumen          64 Oct 15 18:07 3 -> /proc/1616/fd
cat: /dev/fd/0: Permission denied
total 0
lr-x------    1 rumen2   rumen          64 Oct 15 18:07 0 -> pipe:[12554]
l-wx------    1 rumen2   rumen          64 Oct 15 18:07 1 -> pipe:[12555]
l-wx------    1 rumen2   rumen          64 Oct 15 18:07 2 -> pipe:[12556]
lr-x------    1 rumen2   rumen          64 Oct 15 18:07 3 -> /proc/1618/fd
===========================================================
Because "cat" (without file) work, "cat | cat /dev/fd/0" work too. For 
second cat "/dev/fd/0" should be pipe to stdout of first cat.


Darren Tucker wrote:

>Darren Tucker wrote:
>  
>
>>Roumen Petrov wrote:
>>    
>>
>>>Might is linux kernel(?), not ssh(!) problem.     
>>>
>>Quite possibly.  Laurent has opened a kernel Bugzilla bug:
>>http://bugzilla.kernel.org/show_bug.cgi?id=1357
>>    
>>
>Hmm, they closed it because it was a vendor kernel.  I've reproduced it
>with 2.6.0-test7, made a tiny test case and and opened a new bug (can't
>reopen old ones):
>http://bugzilla.kernel.org/show_bug.cgi?id=1360
>
>Looking at the code in session.c, since it seems to work with the
>descriptors are pipe, try adding "#define USE_PIPES 1" to config.h,
>recompile and retest.  
>




More information about the openssh-unix-dev mailing list