From 612f965239a30fe536b11ece1834d9f470aeb029 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 9 Jul 2014 13:22:03 +1000 Subject: - djm@cvs.openbsd.org 2014/07/06 07:42:03 [multiplex.sh test-exec.sh] add a hook to the cleanup() function to kill $SSH_PID if it is set use it to kill the mux master started in multiplex.sh (it was being left around on fatal failures) --- regress/multiplex.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 3e697e691..bc286b5e9 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.21 2013/05/17 04:29:14 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.22 2014/07/06 07:42:03 djm Exp $ # Placed in the Public Domain. CTL=/tmp/openssh.regress.ctl-sock.$$ @@ -29,7 +29,8 @@ start_mux_master() trace "start master, fork to background" ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ -E $TEST_REGRESS_LOGFILE 2>&1 & - MASTER_PID=$! + # NB. $SSH_PID will be killed by test-exec.sh:cleanup on fatal errors. + SSH_PID=$! wait_for_mux_master_ready } @@ -44,6 +45,8 @@ if [ $? -ne 0 ]; then fail "environment not found" fi +fatal ok + verbose "test $tid: transfer" rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" @@ -120,8 +123,8 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 || fail "send exit command failed" # Wait for master to exit -wait $MASTER_PID -kill -0 $MASTER_PID >/dev/null 2>&1 && fail "exit command failed" +wait $SSH_PID +kill -0 $SSH_PID >/dev/null 2>&1 && fail "exit command failed" # Restart master and test -O stop command with master using -N verbose "test $tid: cmd stop" @@ -138,6 +141,8 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ostop otherhost >>$TEST_REGRESS_LOGFILE 2>&1 # wait until both long-running command and master have exited. wait $SLEEP_PID [ $! != 0 ] || fail "waiting for concurrent command" -wait $MASTER_PID +wait $SSH_PID [ $! != 0 ] || fail "waiting for master stop" -kill -0 $MASTER_PID >/dev/null 2>&1 && fail "stop command failed" +kill -0 $SSH_PID >/dev/null 2>&1 && fatal "stop command failed" +SSH_PID="" # Already gone, so don't kill in cleanup + -- cgit v1.2.3 From 7a57eb3d105aa4ced15fb47001092c58811e6d9d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 9 Jul 2014 13:22:31 +1000 Subject: - djm@cvs.openbsd.org 2014/07/07 08:15:26 [multiplex.sh] remove forced-fatal that I stuck in there to test the new cleanup logic and forgot to remove... --- ChangeLog | 4 ++++ regress/multiplex.sh | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 9d40c3193..43f0e7d7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,10 @@ use it to kill the mux master started in multiplex.sh (it was being left around on fatal failures) + - djm@cvs.openbsd.org 2014/07/07 08:15:26 + [multiplex.sh] + remove forced-fatal that I stuck in there to test the new cleanup + logic and forgot to remove... 20140706 - OpenBSD CVS Sync diff --git a/regress/multiplex.sh b/regress/multiplex.sh index bc286b5e9..0a9ed2fbf 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.22 2014/07/06 07:42:03 djm Exp $ +# $OpenBSD: multiplex.sh,v 1.23 2014/07/07 08:15:26 djm Exp $ # Placed in the Public Domain. CTL=/tmp/openssh.regress.ctl-sock.$$ @@ -45,8 +45,6 @@ if [ $? -ne 0 ]; then fail "environment not found" fi -fatal ok - verbose "test $tid: transfer" rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" -- cgit v1.2.3 From 0e4e95566cd95c887f69272499b8f3880b3ec0f5 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 21 Jul 2014 09:52:54 +1000 Subject: - millert@cvs.openbsd.org 2014/07/15 15:54:15 [forwarding.sh multiplex.sh] Add support for Unix domain socket forwarding. A remote TCP port may be forwarded to a local Unix domain socket and vice versa or both ends may be a Unix domain socket. This is a reimplementation of the streamlocal patches by William Ahern from: http://www.25thandclement.com/~william/projects/streamlocal.html OK djm@ markus@ --- ChangeLog | 11 +++++++++++ regress/forwarding.sh | 22 +++++++++++++++++++--- regress/multiplex.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 6 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index d402c4284..a22bef554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +20140721 + - OpenBSD CVS Sync + - millert@cvs.openbsd.org 2014/07/15 15:54:15 + [forwarding.sh multiplex.sh] + Add support for Unix domain socket forwarding. A remote TCP port + may be forwarded to a local Unix domain socket and vice versa or + both ends may be a Unix domain socket. This is a reimplementation + of the streamlocal patches by William Ahern from: + http://www.25thandclement.com/~william/projects/streamlocal.html + OK djm@ markus@ + 20140721 - (dtucker) [cipher.c openbsd-compat/openssl-compat.h] Restore the bits needed to build AES CTR mode against OpenSSL 0.9.8f and above. ok djm diff --git a/regress/forwarding.sh b/regress/forwarding.sh index 94873f22c..f799d4951 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh @@ -1,4 +1,4 @@ -# $OpenBSD: forwarding.sh,v 1.11 2013/06/10 21:56:43 dtucker Exp $ +# $OpenBSD: forwarding.sh,v 1.12 2014/07/15 15:54:15 millert Exp $ # Placed in the Public Domain. tid="local and remote forwarding" @@ -28,7 +28,7 @@ for p in 1 2; do trace "transfer over forwarded channels and check result" ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ somehost cat ${DATA} > ${COPY} - test -f ${COPY} || fail "failed copy of ${DATA}" + test -s ${COPY} || fail "failed copy of ${DATA}" cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" sleep 10 @@ -114,8 +114,24 @@ for p in 1 2; do trace "config file: transfer over forwarded channels and check result" ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ somehost cat ${DATA} > ${COPY} - test -f ${COPY} || fail "failed copy of ${DATA}" + test -s ${COPY} || fail "failed copy of ${DATA}" cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" wait done + +for p in 2; do + trace "transfer over chained unix domain socket forwards and check result" + rm -f $OBJ/unix-[123].fwd + ${SSH} -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep 10 + ${SSH} -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep 10 + ${SSH} -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep 10 + ${SSH} -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep 10 + ${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \ + somehost cat ${DATA} > ${COPY} + test -s ${COPY} || fail "failed copy ${DATA}" + cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" + + #wait + sleep 10 +done diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 0a9ed2fbf..9f5fc38ea 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.23 2014/07/07 08:15:26 djm Exp $ +# $OpenBSD: multiplex.sh,v 1.24 2014/07/15 15:54:15 millert Exp $ # Placed in the Public Domain. CTL=/tmp/openssh.regress.ctl-sock.$$ @@ -72,6 +72,25 @@ test -f ${COPY} || fail "scp: failed copy ${DATA}" cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" rm -f ${COPY} +verbose "test $tid: forward" +trace "forward over TCP/IP and check result" +nc -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & +netcat_pid=$! +${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 +nc 127.0.0.1 $((${PORT} + 2)) > ${COPY} +cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" +kill $netcat_pid 2>/dev/null +rm -f ${COPY} $OBJ/unix-[123].fwd + +trace "forward over UNIX and check result" +nc -N -Ul $OBJ/unix-1.fwd < ${DATA} & +netcat_pid=$! +${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 +${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 +nc -U $OBJ/unix-3.fwd > ${COPY} +cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" +kill $netcat_pid 2>/dev/null +rm -f ${COPY} $OBJ/unix-[123].fwd for s in 0 1 4 5 44; do trace "exit status $s over multiplexed connection" @@ -96,7 +115,7 @@ verbose "test $tid: cmd check" ${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ || fail "check command failed" -verbose "test $tid: cmd forward local" +verbose "test $tid: cmd forward local (TCP)" ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \ || fail "request local forward failed" ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ @@ -106,7 +125,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $P:localhost:$PORT otherhost \ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ && fail "local forward port still listening" -verbose "test $tid: cmd forward remote" +verbose "test $tid: cmd forward remote (TCP)" ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \ || fail "request remote forward failed" ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ @@ -116,6 +135,28 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $P:localhost:$PORT otherhost \ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ && fail "remote forward port still listening" +verbose "test $tid: cmd forward local (UNIX)" +${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ + || fail "request local forward failed" +echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ + || fail "connect to local forward path failed" +${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ + || fail "cancel local forward failed" +N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l) +test ${N} -eq 0 || fail "local forward path still listening" +rm -f $OBJ/unix-1.fwd + +verbose "test $tid: cmd forward remote (UNIX)" +${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ + || fail "request remote forward failed" +echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ + || fail "connect to remote forwarded path failed" +${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ + || fail "cancel remote forward failed" +N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l) +test ${N} -eq 0 || fail "remote forward path still listening" +rm -f $OBJ/unix-1.fwd + verbose "test $tid: cmd exit" ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ || fail "send exit command failed" -- cgit v1.2.3 From c8f610f6cc57ae129758052439d9baf13699097b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 21 Jul 2014 10:23:27 +1000 Subject: - (djm) [regress/multiplex.sh] Not all netcat accept the -N option. --- ChangeLog | 1 + regress/multiplex.sh | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index a22bef554..dcd8d3ee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ of the streamlocal patches by William Ahern from: http://www.25thandclement.com/~william/projects/streamlocal.html OK djm@ markus@ + - (djm) [regress/multiplex.sh] Not all netcat accept the -N option. 20140721 - (dtucker) [cipher.c openbsd-compat/openssl-compat.h] Restore the bits diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 9f5fc38ea..5ef9049d1 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -5,6 +5,18 @@ CTL=/tmp/openssh.regress.ctl-sock.$$ tid="connection multiplexing" +if have_prog nc ; then + if nc -h 2>&1 | grep -- -N >/dev/null; then + NC="nc -N"; + else + NC="nc" + fi +else + echo "skipped (no nc found)" + exit 0 +fi + +trace "will use ProxyCommand $proxycmd" if config_defined DISABLE_FD_PASSING ; then echo "skipped (not supported on this platform)" exit 0 @@ -27,7 +39,7 @@ start_sshd start_mux_master() { trace "start master, fork to background" - ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ + ${SSH} -n2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ -E $TEST_REGRESS_LOGFILE 2>&1 & # NB. $SSH_PID will be killed by test-exec.sh:cleanup on fatal errors. SSH_PID=$! @@ -74,20 +86,20 @@ cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" rm -f ${COPY} verbose "test $tid: forward" trace "forward over TCP/IP and check result" -nc -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & +$NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 -nc 127.0.0.1 $((${PORT} + 2)) > ${COPY} +$NC 127.0.0.1 $((${PORT} + 2)) > ${COPY} cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" kill $netcat_pid 2>/dev/null rm -f ${COPY} $OBJ/unix-[123].fwd trace "forward over UNIX and check result" -nc -N -Ul $OBJ/unix-1.fwd < ${DATA} & +$NC -Ul $OBJ/unix-1.fwd < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 -nc -U $OBJ/unix-3.fwd > ${COPY} +$NC -U $OBJ/unix-3.fwd > ${COPY} cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" kill $netcat_pid 2>/dev/null rm -f ${COPY} $OBJ/unix-[123].fwd @@ -138,22 +150,22 @@ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ verbose "test $tid: cmd forward local (UNIX)" ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "request local forward failed" -echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ +echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ || fail "connect to local forward path failed" ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "cancel local forward failed" -N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l) +N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l) test ${N} -eq 0 || fail "local forward path still listening" rm -f $OBJ/unix-1.fwd verbose "test $tid: cmd forward remote (UNIX)" ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "request remote forward failed" -echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ +echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ || fail "connect to remote forwarded path failed" ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "cancel remote forward failed" -N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l) +N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l) test ${N} -eq 0 || fail "remote forward path still listening" rm -f $OBJ/unix-1.fwd -- cgit v1.2.3 From 5ea4fe00d55453aaa44007330bb4c3181bd9b796 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 22 Jul 2014 09:39:19 +1000 Subject: - (djm) [regress/multiplex.sh] ssh mux master lost -N somehow; put it back --- ChangeLog | 4 ++++ regress/multiplex.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 987647b96..7905150a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20140722 + - (djm) [regress/multiplex.sh] ssh mux master lost -N somehow; + put it back + 20140721 - OpenBSD CVS Sync - millert@cvs.openbsd.org 2014/07/15 15:54:15 diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 5ef9049d1..cc52f4348 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -39,7 +39,7 @@ start_sshd start_mux_master() { trace "start master, fork to background" - ${SSH} -n2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ + ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ -E $TEST_REGRESS_LOGFILE 2>&1 & # NB. $SSH_PID will be killed by test-exec.sh:cleanup on fatal errors. SSH_PID=$! -- cgit v1.2.3 From 04f4824940ea3edd60835416ececbae16438968a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 22 Jul 2014 11:31:47 +1000 Subject: - (djm) [regress/multiplex.sh] change the test for still-open Unix domain sockets to be robust against nc implementations that produce error messages. --- ChangeLog | 3 +++ regress/multiplex.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 7905150a6..16c6bcc12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 20140722 - (djm) [regress/multiplex.sh] ssh mux master lost -N somehow; put it back + - (djm) [regress/multiplex.sh] change the test for still-open Unix + domain sockets to be robust against nc implementations that produce + error messages. 20140721 - OpenBSD CVS Sync diff --git a/regress/multiplex.sh b/regress/multiplex.sh index cc52f4348..16bb5042f 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -154,7 +154,7 @@ echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ || fail "connect to local forward path failed" ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "cancel local forward failed" -N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l) +N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l) test ${N} -eq 0 || fail "local forward path still listening" rm -f $OBJ/unix-1.fwd @@ -166,7 +166,7 @@ echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "cancel remote forward failed" N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l) -test ${N} -eq 0 || fail "remote forward path still listening" +N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l) rm -f $OBJ/unix-1.fwd verbose "test $tid: cmd exit" -- cgit v1.2.3 From cea099a7c4eaecb01b001e5453bb4e5c25006c22 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 23 Jul 2014 10:04:02 +1000 Subject: - djm@cvs.openbsd.org 2014/07/22 01:32:12 [regress/multiplex.sh] change the test for still-open Unix domain sockets to be robust against nc implementations that produce error messages. from -portable (Id sync only) --- ChangeLog | 5 +++++ regress/multiplex.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 3e4bb9d92..db6e1d999 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,11 @@ Convert from to the shiney new ok dtucker@, who also confirmed that -portable handles this already (ID sync only, includes.h pulls in endian.h if available.) + - djm@cvs.openbsd.org 2014/07/22 01:32:12 + [regress/multiplex.sh] + change the test for still-open Unix domain sockets to be robust against + nc implementations that produce error messages. from -portable + (Id sync only) 20140721 - OpenBSD CVS Sync diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 16bb5042f..fc32d13e3 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.24 2014/07/15 15:54:15 millert Exp $ +# $OpenBSD: multiplex.sh,v 1.25 2014/07/22 01:32:12 djm Exp $ # Placed in the Public Domain. CTL=/tmp/openssh.regress.ctl-sock.$$ -- cgit v1.2.3 From 56b840f2b81e14a2f95c203403633a72566736f8 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 25 Jul 2014 08:11:30 +1000 Subject: - (djm) [regress/multiplex.sh] restore incorrectly deleted line; pointed out by Christian Hesse --- ChangeLog | 4 ++++ regress/multiplex.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 4ce4fbdbb..04dea31fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20140725 + - (djm) [regress/multiplex.sh] restore incorrectly deleted line; + pointed out by Christian Hesse + 20140722 - (djm) [regress/multiplex.sh] ssh mux master lost -N somehow; put it back diff --git a/regress/multiplex.sh b/regress/multiplex.sh index fc32d13e3..693211bff 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -165,8 +165,8 @@ echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ || fail "connect to remote forwarded path failed" ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ || fail "cancel remote forward failed" -N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l) N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l) +test ${N} -eq 0 || fail "remote forward path still listening" rm -f $OBJ/unix-1.fwd verbose "test $tid: cmd exit" -- cgit v1.2.3 From a9c46746d266f8a1b092a72b2150682d1af8ebfc Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 1 Aug 2014 12:26:49 +1000 Subject: - (djm) [regress/multiplex.sh] Skip test for non-OpenBSD netcat. We need a better solution, but this will have to do for now. --- ChangeLog | 4 ++++ regress/multiplex.sh | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 5f086f76e..2b2948c15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20130801 + - (djm) [regress/multiplex.sh] Skip test for non-OpenBSD netcat. We need + a better solution, but this will have to do for now. + 20140730 - OpenBSD CVS Sync - millert@cvs.openbsd.org 2014/07/24 22:57:10 diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 693211bff..377281a0c 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -8,11 +8,15 @@ tid="connection multiplexing" if have_prog nc ; then if nc -h 2>&1 | grep -- -N >/dev/null; then NC="nc -N"; - else + elif nc -h 2>&1 | grep -- "-U.*Use UNIX" >/dev/null ; then NC="nc" - fi -else - echo "skipped (no nc found)" + else + echo "nc is incompatible" + fi +fi + +if test -z "$NC" ; then + echo "skipped (no compatible nc found)" exit 0 fi -- cgit v1.2.3 From 5b3879fd4b7a4e3d43bab8f40addda39bc1169d0 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 1 Aug 2014 12:28:31 +1000 Subject: - (djm) [regress/multiplex.sh] Instruct nc not to quit as soon as stdin is closed; avoid regress failures when stdin is /dev/null --- ChangeLog | 2 ++ regress/multiplex.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 2b2948c15..69928b6ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20130801 - (djm) [regress/multiplex.sh] Skip test for non-OpenBSD netcat. We need a better solution, but this will have to do for now. + - (djm) [regress/multiplex.sh] Instruct nc not to quit as soon as stdin + is closed; avoid regress failures when stdin is /dev/null 20140730 - OpenBSD CVS Sync diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 377281a0c..aaeba7f96 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -93,7 +93,7 @@ trace "forward over TCP/IP and check result" $NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 -$NC 127.0.0.1 $((${PORT} + 2)) > ${COPY} +$NC -q5 127.0.0.1 $((${PORT} + 2)) > ${COPY} < /dev/null cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" kill $netcat_pid 2>/dev/null rm -f ${COPY} $OBJ/unix-[123].fwd @@ -103,7 +103,7 @@ $NC -Ul $OBJ/unix-1.fwd < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 -$NC -U $OBJ/unix-3.fwd > ${COPY} +$NC -q5 -U $OBJ/unix-3.fwd > ${COPY} /dev/null rm -f ${COPY} $OBJ/unix-[123].fwd -- cgit v1.2.3 From f8988fbef0c9801d19fa2f8f4f041690412bec37 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 1 Aug 2014 13:31:52 +1000 Subject: - (djm) [regress/multiplex.sh] Use -d (detach stdin) flag to disassociate nc from stdin, it's more portable --- ChangeLog | 2 ++ regress/multiplex.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 69928b6ae..93732f443 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ a better solution, but this will have to do for now. - (djm) [regress/multiplex.sh] Instruct nc not to quit as soon as stdin is closed; avoid regress failures when stdin is /dev/null + - (djm) [regress/multiplex.sh] Use -d (detach stdin) flag to disassociate + nc from stdin, it's more portable 20140730 - OpenBSD CVS Sync diff --git a/regress/multiplex.sh b/regress/multiplex.sh index aaeba7f96..8ee140be6 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -93,7 +93,7 @@ trace "forward over TCP/IP and check result" $NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 -$NC -q5 127.0.0.1 $((${PORT} + 2)) > ${COPY} < /dev/null +$NC -d 127.0.0.1 $((${PORT} + 2)) > ${COPY} < /dev/null cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" kill $netcat_pid 2>/dev/null rm -f ${COPY} $OBJ/unix-[123].fwd @@ -103,7 +103,7 @@ $NC -Ul $OBJ/unix-1.fwd < ${DATA} & netcat_pid=$! ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 -$NC -q5 -U $OBJ/unix-3.fwd > ${COPY} ${COPY} /dev/null rm -f ${COPY} $OBJ/unix-[123].fwd -- cgit v1.2.3