summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sftp-client.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e09afd65a..43f808038 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@
13 stuff. Change suggested by Mark Miller <markm@swoon.net> 13 stuff. Change suggested by Mark Miller <markm@swoon.net>
14 - (bal) Small fix to scp. %lu vs %ld 14 - (bal) Small fix to scp. %lu vs %ld
15 - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS* 15 - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS*
16 - (djm) OpenBSD CVS Sync
17 - djm@cvs.openbsd.org 2001/03/19 03:52:51
18 [sftp-client.c]
19 Report ssh connection closing correctly; ok deraadt@
16 20
1720010318 2120010318
18 - (bal) Fixed scp type casing issue which causes "scp: protocol error: 22 - (bal) Fixed scp type casing issue which causes "scp: protocol error:
@@ -4612,4 +4616,4 @@
4612 - Wrote replacements for strlcpy and mkdtemp 4616 - Wrote replacements for strlcpy and mkdtemp
4613 - Released 1.0pre1 4617 - Released 1.0pre1
4614 4618
4615$Id: ChangeLog,v 1.979 2001/03/19 03:12:25 mouring Exp $ 4619$Id: ChangeLog,v 1.980 2001/03/19 11:29:46 djm Exp $
diff --git a/sftp-client.c b/sftp-client.c
index b0007a734..7be73d29f 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -29,7 +29,7 @@
29/* XXX: copy between two remote sites */ 29/* XXX: copy between two remote sites */
30 30
31#include "includes.h" 31#include "includes.h"
32RCSID("$OpenBSD: sftp-client.c,v 1.14 2001/03/16 08:16:17 djm Exp $"); 32RCSID("$OpenBSD: sftp-client.c,v 1.15 2001/03/19 10:52:51 djm Exp $");
33 33
34#include "ssh.h" 34#include "ssh.h"
35#include "buffer.h" 35#include "buffer.h"
@@ -77,7 +77,9 @@ get_msg(int fd, Buffer *m)
77 unsigned char buf[4096]; 77 unsigned char buf[4096];
78 78
79 len = atomicio(read, fd, buf, 4); 79 len = atomicio(read, fd, buf, 4);
80 if (len != 4) 80 if (len == 0)
81 fatal("Connection closed");
82 else if (len == -1)
81 fatal("Couldn't read packet: %s", strerror(errno)); 83 fatal("Couldn't read packet: %s", strerror(errno));
82 84
83 msg_len = GET_32BIT(buf); 85 msg_len = GET_32BIT(buf);
@@ -86,7 +88,9 @@ get_msg(int fd, Buffer *m)
86 88
87 while (msg_len) { 89 while (msg_len) {
88 len = atomicio(read, fd, buf, MIN(msg_len, sizeof(buf))); 90 len = atomicio(read, fd, buf, MIN(msg_len, sizeof(buf)));
89 if (len <= 0) 91 if (len == 0)
92 fatal("Connection closed");
93 else if (len == -1)
90 fatal("Couldn't read packet: %s", strerror(errno)); 94 fatal("Couldn't read packet: %s", strerror(errno));
91 95
92 msg_len -= len; 96 msg_len -= len;