xref: /freebsd/crypto/openssh/regress/stderr-after-eof.sh (revision b0d29bc47dba79f6f38e67eabadfb4b32ffd9390)
1#	$OpenBSD: stderr-after-eof.sh,v 1.3 2017/04/30 23:34:55 djm 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} -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