Little Bug under Win32

Christian Fruth jt.kirk at earthling.net
Tue Feb 13 06:30:25 EST 2001


Hi

    I found a small Bug when compiling OpenSSH under Win32 using Cygwin.

    When you use SSH as a interactive Shell everthing looks normal but when
    you try to transfer binary data via SSH you will get only garbage.

    Example:
        ssh -l root -i ./.ssh/identity server1 cat /tmp/test.tar.gz >
c:\test.tar.gz

    The problem is that stdout is opend as Text-File so every LF which comes
    from the SSH-Server (Unix) will be translated to CR LF
    on a Win32-Machine.

    The problem can be fixed by adding following line to the beginning of
    the clientloop-function:

        setmode(fileno(stdout), O_BINARY);

Christian






More information about the openssh-unix-dev mailing list