summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--openbsd-compat/bsd-cygwin_util.c3
-rw-r--r--openbsd-compat/bsd-cygwin_util.h4
-rw-r--r--scp.c3
-rw-r--r--sftp-server.c5
5 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b612b024..918c843b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
20010414
- Sync with OpenBSD glob.c, strlcat.c and vis.c changes
+ - Cygwin sftp/sftp-server binary mode patch from Corinna Vinschen
+ <vinschen@redhat.com>
20010413
- OpenBSD CVS Sync
@@ -5052,4 +5054,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1108 2001/04/13 14:22:33 djm Exp $
+$Id: ChangeLog,v 1.1109 2001/04/13 14:28:42 djm Exp $
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index ea981be5..36f13e3f 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -15,12 +15,11 @@
#include "includes.h"
-RCSID("$Id: bsd-cygwin_util.c,v 1.3 2001/02/18 01:30:56 djm Exp $");
+RCSID("$Id: bsd-cygwin_util.c,v 1.4 2001/04/13 14:28:42 djm Exp $");
#ifdef HAVE_CYGWIN
#include <fcntl.h>
-#include <io.h>
#include <stdlib.h>
#include <sys/vfs.h>
#include <windows.h>
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h
index e2d4b4da..7879501e 100644
--- a/openbsd-compat/bsd-cygwin_util.h
+++ b/openbsd-compat/bsd-cygwin_util.h
@@ -13,13 +13,15 @@
* binary mode on Windows systems.
*/
-/* $Id: bsd-cygwin_util.h,v 1.3 2001/02/18 01:30:56 djm Exp $ */
+/* $Id: bsd-cygwin_util.h,v 1.4 2001/04/13 14:28:43 djm Exp $ */
#ifndef _BSD_CYGWIN_UTIL_H
#define _BSD_CYGWIN_UTIL_H
#ifdef HAVE_CYGWIN
+#include <io.h>
+
int binary_open(const char *filename, int flags, ...);
int binary_pipe(int fd[2]);
int check_nt_auth(int pwd_authenticated, uid_t uid);
diff --git a/scp.c b/scp.c
index d317a71e..c654cb66 100644
--- a/scp.c
+++ b/scp.c
@@ -291,6 +291,9 @@ main(argc, argv)
case 't': /* "to" */
iamremote = 1;
tflag = 1;
+#ifdef HAVE_CYGWIN
+ setmode(0, O_BINARY);
+#endif
break;
default:
usage();
diff --git a/sftp-server.c b/sftp-server.c
index 0695a982..75c19c8a 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1043,6 +1043,11 @@ main(int ac, char **av)
in = dup(STDIN_FILENO);
out = dup(STDOUT_FILENO);
+#ifdef HAVE_CYGWIN
+ setmode(in, O_BINARY);
+ setmode(out, O_BINARY);
+#endif
+
max = 0;
if (in > max)
max = in;