- (djm) OpenBSD CVS Sync

- djm@cvs.openbsd.org     2001/03/19 03:52:51
     [sftp-client.c]
     Report ssh connection closing correctly; ok deraadt@
This commit is contained in:
Damien Miller 2001-03-19 22:29:46 +11:00
parent 03017ba638
commit cafff19105
2 changed files with 12 additions and 4 deletions

View File

@ -13,6 +13,10 @@
stuff. Change suggested by Mark Miller <markm@swoon.net> stuff. Change suggested by Mark Miller <markm@swoon.net>
- (bal) Small fix to scp. %lu vs %ld - (bal) Small fix to scp. %lu vs %ld
- (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS* - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS*
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2001/03/19 03:52:51
[sftp-client.c]
Report ssh connection closing correctly; ok deraadt@
20010318 20010318
- (bal) Fixed scp type casing issue which causes "scp: protocol error: - (bal) Fixed scp type casing issue which causes "scp: protocol error:
@ -4612,4 +4616,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.979 2001/03/19 03:12:25 mouring Exp $ $Id: ChangeLog,v 1.980 2001/03/19 11:29:46 djm Exp $

View File

@ -29,7 +29,7 @@
/* XXX: copy between two remote sites */ /* XXX: copy between two remote sites */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sftp-client.c,v 1.14 2001/03/16 08:16:17 djm Exp $"); RCSID("$OpenBSD: sftp-client.c,v 1.15 2001/03/19 10:52:51 djm Exp $");
#include "ssh.h" #include "ssh.h"
#include "buffer.h" #include "buffer.h"
@ -77,7 +77,9 @@ get_msg(int fd, Buffer *m)
unsigned char buf[4096]; unsigned char buf[4096];
len = atomicio(read, fd, buf, 4); len = atomicio(read, fd, buf, 4);
if (len != 4) if (len == 0)
fatal("Connection closed");
else if (len == -1)
fatal("Couldn't read packet: %s", strerror(errno)); fatal("Couldn't read packet: %s", strerror(errno));
msg_len = GET_32BIT(buf); msg_len = GET_32BIT(buf);
@ -86,7 +88,9 @@ get_msg(int fd, Buffer *m)
while (msg_len) { while (msg_len) {
len = atomicio(read, fd, buf, MIN(msg_len, sizeof(buf))); len = atomicio(read, fd, buf, MIN(msg_len, sizeof(buf)));
if (len <= 0) if (len == 0)
fatal("Connection closed");
else if (len == -1)
fatal("Couldn't read packet: %s", strerror(errno)); fatal("Couldn't read packet: %s", strerror(errno));
msg_len -= len; msg_len -= len;