summaryrefslogtreecommitdiff
path: root/security/ssh2/patches
diff options
context:
space:
mode:
authorkivinen <kivinen@pkgsrc.org>2004-05-28 12:00:10 +0000
committerkivinen <kivinen@pkgsrc.org>2004-05-28 12:00:10 +0000
commitaa1545a9528897f74ce5007adf29ed0523c563b7 (patch)
tree80af44d3c1f28c4b74d8cfc557274e348e171729 /security/ssh2/patches
parent007869847ef1103ff08085f39ed76c0a130f6bec (diff)
downloadpkgsrc-aa1545a9528897f74ce5007adf29ed0523c563b7.tar.gz
Fixed bug, which only appeared in the NetBSD 2.0 systems where the
write can return 0 even when the select has indicated that socket is writable. Do not consider this error, but call select again.
Diffstat (limited to 'security/ssh2/patches')
-rw-r--r--security/ssh2/patches/patch-ah28
1 files changed, 28 insertions, 0 deletions
diff --git a/security/ssh2/patches/patch-ah b/security/ssh2/patches/patch-ah
new file mode 100644
index 00000000000..f3491201f37
--- /dev/null
+++ b/security/ssh2/patches/patch-ah
@@ -0,0 +1,28 @@
+$NetBSD: patch-ah,v 1.3 2004/05/28 12:00:10 kivinen Exp $
+
+--- lib/sshutil/sshsysutil/sshunixfdstream.c.orig 2003-12-03 15:17:31.000000000 +0200
++++ lib/sshutil/sshsysutil/sshunixfdstream.c
+@@ -337,16 +337,21 @@ int ssh_stream_fd_write(void *context, c
+ if (sdata->writefd >= 0)
+ {
+ len = write(sdata->writefd, buf, size);
+- if (len >= 0)
++ if (len > 0)
+ return len;
+
+- if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
++ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR ||
++ /* Special case for NetBSD 2.0, it may return len = 0 and errno = 0
++ which simply means, try again */
++ (len == 0 && errno == 0))
+ {
+ /* Cannot write more at this time. */
+ sdata->write_has_failed = TRUE;
+ ssh_stream_fd_request(sdata);
+ return -1;
+ }
++ else if (len == 0)
++ return 0;
+
+ /* A real error occurred while writing. */
+ sdata->write_has_failed = TRUE;