xref: /freebsd/crypto/openssh/regress/stderr-after-eof.sh (revision b740c88bfb6453416926271c089262e7164dace3)
1#	$OpenBSD: stderr-after-eof.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $
2#	Placed in the Public Domain.
3
4tid="stderr data after eof"
5
6# setup data
7rm -f ${DATA} ${COPY}
8cp /dev/null ${DATA}
9for i in 1 2 3 4 5 6; do
10	(date;echo $i) | md5 >> ${DATA}
11done
12
13${SSH} -2 -F $OBJ/ssh_proxy otherhost \
14	exec sh -c \'"exec > /dev/null; sleep 2; cat ${DATA} 1>&2 $s"\' \
15	2> ${COPY}
16r=$?
17if [ $r -ne 0 ]; then
18	fail "ssh failed with exit code $r"
19fi
20egrep 'Disconnecting: Received extended_data after EOF' ${COPY} &&
21	fail "ext data received after eof"
22cmp ${DATA} ${COPY}	|| fail "stderr corrupt"
23
24rm -f ${DATA} ${COPY}
25