48cef7a
From 4f60e4f66b5880c9f50ef758e8b7f7a9ae786d21 Mon Sep 17 00:00:00 2001
48cef7a
From: Darren Tucker <dtucker@dtucker.net>
48cef7a
Date: Fri, 13 Apr 2018 13:13:33 +1000
48cef7a
Subject: [PATCH 1/5] Revert $REGRESSTMP changes.
48cef7a
48cef7a
Revert 3fd2d229 and subsequent changes as they turned out to be a
48cef7a
portability hassle.
48cef7a
---
48cef7a
 Makefile.in | 4 +---
48cef7a
 1 file changed, 1 insertion(+), 3 deletions(-)
48cef7a
48cef7a
diff --git a/Makefile.in b/Makefile.in
48cef7a
index 04e1c8e53..dd942ee7b 100644
48cef7a
--- a/Makefile.in
48cef7a
+++ b/Makefile.in
48cef7a
@@ -577,8 +577,6 @@ regress-binaries: regress/modpipe$(EXEEXT) \
48cef7a
 	regress/unittests/pkcs11/test_pkcs11$(EXEEXT) \
48cef7a
 	regress/misc/kexfuzz/kexfuzz$(EXEEXT)
48cef7a
 
48cef7a
-REGRESSTMP = "$(PWD)/regress"
48cef7a
-
48cef7a
 tests interop-tests t-exec unit: regress-prep regress-binaries $(TARGETS)
48cef7a
 	BUILDDIR=`pwd`; \
48cef7a
 	TEST_SSH_SCP="$${BUILDDIR}/scp"; \
48cef7a
@@ -602,7 +600,7 @@ tests interop-tests t-exec unit: regress-prep regress-binaries $(TARGETS)
48cef7a
 		.OBJDIR="$${BUILDDIR}/regress" \
48cef7a
 		.CURDIR="`pwd`" \
48cef7a
 		BUILDDIR="$${BUILDDIR}" \
48cef7a
-		OBJ="$(REGRESSTMP)" \
48cef7a
+		OBJ="$${BUILDDIR}/regress/" \
48cef7a
 		PATH="$${BUILDDIR}:$${PATH}" \
48cef7a
 		TEST_ENV=MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
48cef7a
 		TEST_MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
48cef7a
48cef7a
From b81b2d120e9c8a83489e241620843687758925ad Mon Sep 17 00:00:00 2001
48cef7a
From: Damien Miller <djm@mindrot.org>
48cef7a
Date: Fri, 13 Apr 2018 13:38:06 +1000
48cef7a
Subject: [PATCH 2/5] Fix tunnel forwarding broken in 7.7p1
48cef7a
48cef7a
bz2855, ok dtucker@
48cef7a
---
48cef7a
 openbsd-compat/port-net.c | 4 ++--
48cef7a
 1 file changed, 2 insertions(+), 2 deletions(-)
48cef7a
48cef7a
diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c
48cef7a
index 7050629c3..bb535626f 100644
48cef7a
--- a/openbsd-compat/port-net.c
48cef7a
+++ b/openbsd-compat/port-net.c
48cef7a
@@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname)
48cef7a
 	else
48cef7a
 		debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd);
48cef7a
 
48cef7a
-	if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)))
48cef7a
+	if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
48cef7a
 		goto failed;
48cef7a
 
48cef7a
 	return (fd);
48cef7a
@@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname)
48cef7a
 			goto failed;
48cef7a
 	}
48cef7a
 
48cef7a
-	if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)))
48cef7a
+	if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
48cef7a
 		goto failed;
48cef7a
 
48cef7a
 	close(sock);
48cef7a
48cef7a
From 341727df910e12e26ef161508ed76d91c40a61eb Mon Sep 17 00:00:00 2001
48cef7a
From: "djm@openbsd.org" <djm@openbsd.org>
48cef7a
Date: Mon, 9 Apr 2018 23:54:49 +0000
48cef7a
Subject: [PATCH 3/5] upstream: don't kill ssh-agent's listening socket
48cef7a
 entriely if we
48cef7a
48cef7a
fail to accept a connection; bz#2837, patch from Lukas Kuster
48cef7a
48cef7a
OpenBSD-Commit-ID: 52413f5069179bebf30d38f524afe1a2133c738f
48cef7a
---
48cef7a
 ssh-agent.c | 7 +++----
48cef7a
 1 file changed, 3 insertions(+), 4 deletions(-)
48cef7a
48cef7a
diff --git a/ssh-agent.c b/ssh-agent.c
48cef7a
index 2a4578b03..68de56ce6 100644
48cef7a
--- a/ssh-agent.c
48cef7a
+++ b/ssh-agent.c
48cef7a
@@ -1,4 +1,4 @@
48cef7a
-/* $OpenBSD: ssh-agent.c,v 1.228 2018/02/23 15:58:37 markus Exp $ */
48cef7a
+/* $OpenBSD: ssh-agent.c,v 1.229 2018/04/09 23:54:49 djm Exp $ */
48cef7a
 /*
48cef7a
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
48cef7a
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
48cef7a
@@ -909,9 +909,8 @@ after_poll(struct pollfd *pfd, size_t npfd)
48cef7a
 		/* Process events */
48cef7a
 		switch (sockets[socknum].type) {
48cef7a
 		case AUTH_SOCKET:
48cef7a
-			if ((pfd[i].revents & (POLLIN|POLLERR)) != 0 &&
48cef7a
-			    handle_socket_read(socknum) != 0)
48cef7a
-				close_socket(&sockets[socknum]);
48cef7a
+			if ((pfd[i].revents & (POLLIN|POLLERR)) != 0)
48cef7a
+				handle_socket_read(socknum);
48cef7a
 			break;
48cef7a
 		case AUTH_CONNECTION:
48cef7a
 			if ((pfd[i].revents & (POLLIN|POLLERR)) != 0 &&
48cef7a
48cef7a
From 3402cc607049ac900f6d8574bc2ce657a8cdf4fe Mon Sep 17 00:00:00 2001
48cef7a
From: Darren Tucker <dtucker@dtucker.net>
48cef7a
Date: Fri, 13 Apr 2018 13:43:55 +1000
48cef7a
Subject: [PATCH 4/5] Using "==" in shell tests is not portable.
48cef7a
48cef7a
Patch from rsbecker at nexbridge.com.
48cef7a
---
48cef7a
 configure.ac | 2 +-
48cef7a
 1 file changed, 1 insertion(+), 1 deletion(-)
48cef7a
48cef7a
diff --git a/configure.ac b/configure.ac
48cef7a
index 663062bef..2e84d90b7 100644
48cef7a
--- a/configure.ac
48cef7a
+++ b/configure.ac
48cef7a
@@ -1398,7 +1398,7 @@ AC_RUN_IFELSE(
48cef7a
 )
48cef7a
 AC_MSG_RESULT([$func_calloc_0_nonnull])
48cef7a
 
48cef7a
-if test "x$func_calloc_0_nonnull" == "xyes"; then
48cef7a
+if test "x$func_calloc_0_nonnull" = "xyes"; then
48cef7a
 	AC_DEFINE(HAVE_CALLOC, 1, [calloc(0, x) returns non-null])
48cef7a
 else
48cef7a
 	AC_DEFINE(HAVE_CALLOC, 0, [calloc(0, x) returns NULL])
48cef7a
48cef7a
From 85fe48fd49f2e81fa30902841b362cfbb7f1933b Mon Sep 17 00:00:00 2001
48cef7a
From: "djm@openbsd.org" <djm@openbsd.org>
48cef7a
Date: Sat, 14 Apr 2018 21:50:41 +0000
48cef7a
Subject: [PATCH 5/5] upstream: don't free the %C expansion, it's used later
48cef7a
 for
48cef7a
48cef7a
LocalCommand
48cef7a
48cef7a
OpenBSD-Commit-ID: 857b5cb37b2d856bfdfce61289a415257a487fb1
48cef7a
---
48cef7a
 ssh.c | 1 -
48cef7a
 1 file changed, 1 deletion(-)
48cef7a
48cef7a
diff --git a/ssh.c b/ssh.c
48cef7a
index d3619fe29..9c011dd7e 100644
48cef7a
--- a/ssh.c
48cef7a
+++ b/ssh.c
48cef7a
@@ -1323,7 +1323,6 @@ main(int ac, char **av)
48cef7a
 		    (char *)NULL);
48cef7a
 		free(cp);
48cef7a
 	}
48cef7a
-	free(conn_hash_hex);
48cef7a
 
48cef7a
 	if (config_test) {
48cef7a
 		dump_client_config(&options, host);