OpenSSH & MinGW?

Ed Phillips ed at UDel.Edu
Sat Jul 13 06:01:58 EST 2002


On Fri, 12 Jul 2002, Nicolas Williams wrote:

> Date: Fri, 12 Jul 2002 15:17:46 -0400
> From: Nicolas Williams <Nicolas.Williams at ubsw.com>
> To: Ed Phillips <ed at UDel.Edu>
> Cc: OpenSSH Development <openssh-unix-dev at mindrot.org>
> Subject: Re: OpenSSH & MinGW?
>
> On Fri, Jul 12, 2002 at 02:59:56PM -0400, Ed Phillips wrote:
> > On Fri, 12 Jul 2002 Nicolas.Williams at ubsw.com wrote:
> > > Any other glaring gotchas?
> >
> > Well, the tty-related stuff would be a headache for starters - an "MS-DOS
> > prompt" isn't really a tty-compatible entity, except in the DOS
> > "look-I-can-print-funky-DOS-symbols-and-escape-sequences" sense.  That
> > problem in itself is probably enough to snuff any urges I might to port to
> > MinGW.  You really need a terminal emulator to run the ssh client "inside
> > of".
>
> Yes. Echo-off prompting would have to be done differently. That's about
> the extent of client-side tty-handling in OpenSSH though. Not too bad.

That's specific to the ssh client itself, but the problem on Windows is
that a "console-mode" application runs in an "MS-DOS Prompt" window.
That window has no terminal functions (as opposed to an xterm running on a
Unix box).  If you type into an MS-DOS Prompt window that is running the
ssh client that is calling "read(0, ...)", will it receive every keystroke
immediately when you type it?  I doubt it.  Maybe some sort of
Windows-console-mode curses library could do it, or some GUI terminal
emulator API.

It would be easy enough to try to write a console-mode program that just
calls _read(0, ...) and _write(1, ...) and see what keystrokes can make it
through, and whether you have to press return before you see them, and
whether ctrl-c can make it through, etc.

It's amazing how easy it is to forget all of the "machinery" that is
between a simple keystroke and a remote application... ;-)

> > Also, on Windows there is no "open", "close", etc., but there is "_open",
> > "_close", etc.,... and some of them have different arguments or omit
> > arguments.
>
> Such things can be worked out.

Agreed.

> > Basically, there's a lot of hacking you would have to do, at minimum...
>
> I've been guessing so - I was hoping someone had tried who could give me
> some advice on the matter.
>
> > > Hmmm, I'd need the MIT krb5 stuff to build under MinGW as well...
> >
> > I don't know if anyone has tried it with MinGW, but certainly people do
> > this sort of port to Cygwin (not that it helps you any).
>
> Actually, that was thinko. The MIT krb5 stuff compiles natively on
> Windows (it's called MIT Kfw - Kerberos For Windows). So there's the
> answer to that. OpenSSL and MIT krb5 and zlib should all build with
> MingW no problem

Okay... I forgot about the Kerberos For Windows "initiative".  It was
pretty "ugly" last time I looked.  MS-DOS .bat programs to rename source
files and such... ugh.

> - OpenSSH's ssh(1) is another matter.

Yes... as far as I can see.  You might find source to a Windows-ified
telnet or rlogin client and see how their built (whether they're using
console-mode or some GUI terminal layer).

	Ed

Ed Phillips <ed at udel.edu> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
finger -l ed at polycut.nss.udel.edu for PGP public key




More information about the openssh-unix-dev mailing list