corrupted copy in regress/multiplex.sh

Damien Miller djm at mindrot.org
Fri Aug 1 10:42:17 EST 2014


On Fri, 1 Aug 2014, Damien Miller wrote:

> I'm looking at this at the moment. It happens when the test is run with
> stdin set to /dev/null - I thought I had it figured out yesterday, but now
> I'm not so sure...

I think this fixes it. nc was closing as soon as it saw an EOF on stdin,
regardless of data still coming from the socket.

diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index 693211b..b33e732 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -89,7 +89,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
@@ -99,7 +99,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
 cmp ${DATA} ${COPY}		|| fail "ssh: corrupted copy of ${DATA}"
 kill $netcat_pid 2>/dev/null
 rm -f ${COPY} $OBJ/unix-[123].fwd


More information about the openssh-unix-dev mailing list