Port of OpenSSH-2.1.1p4 to Cygwin

Corinna Vinschen vinschen at cygnus.com
Thu Aug 3 18:49:55 EST 2000


Damien Miller wrote:
> 
> On Wed, 2 Aug 2000, Corinna Vinschen wrote:
> 
> > You know that this is impossible, do you?
> >
> > The underlying system is using two byte line endings and there
> > has to be a method to disallow CRLF <-> LF translation for
> > reading binary files in contrast to text files.
> 
> Why should read() and write() do line ending translations anyway?

There are many applications which are using read/write for
text files for example `ash' while others are using read/write
for binary operations like `od'.

The current port to Cygwin is using text mode as default
so I could drop the

	fopen(foo, "rt")

constructs which some people on this mailing list objects to.
Now it's the problem with O_BINARY in open calls. Sigh.

> > On the other hand I don't understand where the problem is.
> > The O_BINARY usage in the patch is transparent to all
> > other operating systems and many parts of the sources contain
> > special code for different OSes like HPUX, Solaris, NeXT etc.
> 
> It makes keeping the portable version in sync with the OpenBSD tree
> much more difficult (lots more broken diffs) why is why I haven't
> merged these changes.

I have solved that now as follows:

I have created a new file `cygwin_util.c' which contains the
function `binary_open' which in turn calls `open' with O_BINARY
flag if and only if HAVE_CYGWIN is defined.

In `includes.h' and `bsd-mktemp.c' (because it doesn't include
`includes.h') I have added the following lines:

#ifdef HAVE_CYGWIN
#define open binary_open
extern int binary_open();
#endif

This has the result that the O_BINARY is only used in the new
`cygwin_util.c' file.

I hope that this is according to your needs.

I have attached the complete patch to version 2.1.1p4 again as
gzip'd file because of it's size. It contains two additional
modifications which were needed to get sshd running under inetd
on NT/W2K and to get sshd working on 9X.

ChangeLog:
==========
 - Makefile.in: Changed to support $EXEEXT transparently.Added
   `cygwin_util.o' to the dependencies of LIBSSH_OBJS.
 - acconfig.h: Add HAVE_CYGWIN.
 - auth-passwd.c: Support getting NT passwords via Cygwin special
   functions. Disable check for uid = 0 when compiled for Cygwin.
 - auth1.c: Reject changing user context if not authenticated via
   password under Windows NT. Disable check for uid = 0 when HAVE_CYGWIN
   is set.
 - authfile.c: Disable check for file modes when HAVE_CYGWIN is set.
 - bsd-daemon.c: Avoid possible race condition under Cygwin.
 - bsd-mktemp.c: Define `open' as `binary_open' when HAVE_CYGWIN is set.
 - config.h.in: Add HAVE_CYGWIN.
 - configure.in: Add *-*-cygwin as target. Call AC_EXEEXT now.
 - cygwin_util.c: New file containing just `binary_open' function.
 - includes.h: Use HAVE_CYGWIN to care for include files. Define `open'
   as `binary_open' when HAVE_CYGWIN is set.
 - loginrec.c: Disable check for uid 0 when HAVE_CYGWIN is set.
 - pty.c: Disable HAVE_VHANGUP explicitely if HAVE_CYGWIN is set.
   Don't call I_PUSH ioctl's under Cygwin.
 - scp.c: Call tcgetpgrp() instead of ioctl(..., TIOCGPGRP) to get the
   controlling terminal when HAVE_CYGWIN is set.
 - session.c: Close xauthfiles immediatly to avoid implicit file
   lockings on Windows NT systems. Changes in environment setting.
   Disable check for uid 0 when HAVE_CYGWIN is set. Don't call xauth
   with `.../unix' syntax under Cygwin.
 - ssh.c: Disable setrlimit call under Cygwin. Take care for `.exe' file
   extension.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                        mailto:cygwin at sources.redhat.com
Red Hat, Inc.
mailto:vinschen at cygnus.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openssh-2.1.1p4.p0.gz
Type: application/x-gzip
Size: 5994 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20000803/06f3e90f/attachment.bin 


More information about the openssh-unix-dev mailing list